Skip to content

puccinia/cmdargs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cmdargs

Command line argument parser for Rust.

Crates.io Crates.io Rust Documentation License Contributors

NOTE: this library is under development and "not production ready".

Usage

Add the following to your Cargo.toml:

[dependencies]
cmdargs = "0.1.0"

Example:

use cmdargs;

fn main() {
    let parser = cmdargs::parser_from_str! {"
        Usage: hello-world [options]

        Options:
          -a, --all        Print Hello World
          -H, --hello      Print Hello
          -W, --world      Print World

          -h, --help       Print help information
          -V, --version    Print version information
    "};
    parser.parse();

    println!("Hello World!");
}

About

Command line argument parser for Rust

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages