cmdargs

Crates.iocmdargs
lib.rscmdargs
version0.1.1
sourcesrc
created_at2022-05-02 22:53:15.146828
updated_at2022-05-05 05:15:05.738857
descriptionCommand line argument parser for Rust
homepagehttps://github.com/puccinia/cmdargs.git
repositoryhttps://github.com/puccinia/cmdargs.git
max_upload_size
id579389
size4,329
Everaldo Canuto (ecanuto)

documentation

README

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.1"

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!");
}
Commit count: 11

cargo fmt