cmdargs 0.1.1

Command line argument parser for Rust
Documentation
  • Coverage
  • 0%
    0 out of 16 items documented0 out of 12 items with examples
  • Size
  • Source code size: 4.24 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.36 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 10s Average build duration of successful builds.
  • all releases: 10s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • puccinia/cmdargs
    2 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • ecanuto

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!");
}