1 unstable release

0.1.0 Sep 11, 2023

#1891 in Parser implementations

Download history 24/week @ 2024-02-19 13/week @ 2024-02-26 8/week @ 2024-03-04 18/week @ 2024-03-11 5/week @ 2024-03-18 8/week @ 2024-03-25 23/week @ 2024-04-01

56 downloads per month

MIT/Apache

6KB
63 lines

Stars Forks

Argin

A very simple command line argument parser.

  • Description
  • Getting Started
  • Help
  • Authors
  • Versions
  • License
  • Description

    Argin is a very simple library with only 5 functions but its still able to do all the expected argument parsing

    Getting Started

    Usage

    Example

    ./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();
    

    Functions

    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
    

    Help

    Its common to forget .parse() at the end

    Authors

    Contributors names and contact info

    Versions

    • 0.1
      • Initial Release

    License

    Currently there is no license, this may change in the future

    No runtime deps