Yet another argument parser for rust
Find a file
2026-07-28 13:06:18 +02:00
src add a test for subcommand usage 2026-07-28 13:06:18 +02:00
tests add a test for subcommand usage 2026-07-28 13:06:18 +02:00
.gitignore add argument tokenizer 2026-07-16 11:45:11 +02:00
Cargo.lock remove unused c-main optional dependency 2026-07-22 09:05:26 +02:00
Cargo.toml remove unused c-main optional dependency 2026-07-22 09:05:26 +02:00
README.md fix rustdoc warning and add README 2026-07-22 08:38:31 +02:00

no_std_args - A #[no_std] command-line argument parser for rust.

See crate documentation for more details.

Example:

    use no_std_args::*;

    label! {
        Funny = "funny";
        Sad = "sad";
        Name = "<name>";
        Extras = "<extras>";
    }

    let cmd = const {
        Command::new()
            .with_switch(Switch::short('f').with_long("funny").with_label(Funny))
            .with_switch(Switch::short('s').with_label(Sad))
            .with_argument(Positional::new().optional().with_label(Name))
            .with_argument(Remainder::new().with_label(Extras))
    };
    let result = cmd.process(["cmd", "-s", "giuseppe", "and", "friends"]).unwrap();
    assert_eq!(*result.get(Funny), false);
    assert_eq!(*result.get(Sad), true);
    assert_eq!(*result.get(Name), Some("giuseppe"));
    assert_eq!(*result.get(Extras), ["and", "friends"]);