File: name.rs

package info (click to toggle)
rust-jargon-args 0.2.5-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 200 kB
  • sloc: makefile: 4
file content (11 lines) | stat: -rw-r--r-- 295 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
use jargon_args::*;

fn main() {
    let mut j: Jargon = Jargon::from_env();
    let name_key: Key = "--name".into();

    match j.option_arg::<String, Key>(name_key.clone()) {
        Some(n) => println!("Your name: {}", n),
        None => eprintln!("Missing argument: {}", name_key),
    }
}