How to access subcommand flags? #2338
-
I'm using yaml and have something like this name: myApp
args:
- verbose
subcommands:
- search
args:
- module Following your example, I've matched by subcommands as follows match opts.subcommand_name(){
Some("search") => {
println!("{}", args.value_of("module"));
}
} In the above example, I get How do I access the subcommand flags? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
A generic rust answer, https://doc.rust-lang.org/book/ch18-03-pattern-syntax.html#destructuring-to-break-apart-values Clap example, https://github.com/clap-rs/clap#using-builder-pattern (check the code below) |
Beta Was this translation helpful? Give feedback.
A generic rust answer, https://doc.rust-lang.org/book/ch18-03-pattern-syntax.html#destructuring-to-break-apart-values
Clap example, https://github.com/clap-rs/clap#using-builder-pattern (check the code below)