Crates.io | argin |
lib.rs | argin |
version | 0.1.0 |
source | src |
created_at | 2023-09-11 19:33:31.717606 |
updated_at | 2023-09-11 19:33:31.717606 |
description | A very simple command line argument parser |
homepage | |
repository | https://github.com/proxin187/argin |
max_upload_size | |
id | 970043 |
size | 5,040 |
A very simple command line argument parser.
Argin is a very simple library with only 5 functions but its still able to do all the expected argument parsing
./program [file] [-format (name)]
would look like this:
use argin::Argin;
let arg = Argin::new();
arg.add_positional_arg();
arg.add_value("-format");
let args = arg.parse();
let file = args.pos_arg.get(0).unwrap();
let format = arg.values.get("-format").unwrap();
new:
pub fn new() -> Argin
add_flag:
pub fn add_flag(&mut self, flag: &str)
add_value:
pub fn add_value(&mut self, name: &str)
add_positional_arg:
pub fn add_positional_arg(&mut self)
parse:
pub fn parse(&self) -> Argin
Its common to forget .parse() at the end
Contributors names and contact info
Currently there is no license, this may change in the future