diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:06:37 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:06:37 +0000 |
commit | 246f239d9f40f633160f0c18f87a20922d4e77bb (patch) | |
tree | 5a88572663584b3d4d28e5a20e10abab1be40884 /vendor/clap/examples/derive_ref/augment_args.rs | |
parent | Releasing progress-linux version 1.64.0+dfsg1-1~progress7.99u1. (diff) | |
download | rustc-246f239d9f40f633160f0c18f87a20922d4e77bb.tar.xz rustc-246f239d9f40f633160f0c18f87a20922d4e77bb.zip |
Merging debian version 1.65.0+dfsg1-2.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | vendor/clap/examples/derive_ref/augment_args.rs | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/vendor/clap/examples/derive_ref/augment_args.rs b/vendor/clap/examples/derive_ref/augment_args.rs index 390c72f4a..310556914 100644 --- a/vendor/clap/examples/derive_ref/augment_args.rs +++ b/vendor/clap/examples/derive_ref/augment_args.rs @@ -1,6 +1,6 @@ -use clap::{arg, Args as _, Command, FromArgMatches as _, Parser}; +use clap::{arg, Args, Command, FromArgMatches as _}; -#[derive(Parser, Debug)] +#[derive(Args, Debug)] struct DerivedArgs { #[clap(short, long, action)] derived: bool, @@ -12,13 +12,10 @@ fn main() { let cli = DerivedArgs::augment_args(cli); let matches = cli.get_matches(); - println!( - "Value of built: {:?}", - *matches.get_one::<bool>("built").unwrap() - ); + println!("Value of built: {:?}", matches.get_flag("built")); println!( "Value of derived via ArgMatches: {:?}", - *matches.get_one::<bool>("derived").unwrap() + matches.get_flag("derived") ); // Since DerivedArgs implements FromArgMatches, we can extract it from the unstructured ArgMatches. |