summaryrefslogtreecommitdiffstats
path: root/vendor/clap/examples/tutorial_derive/03_01_flag_bool.rs
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/clap/examples/tutorial_derive/03_01_flag_bool.rs')
-rw-r--r--vendor/clap/examples/tutorial_derive/03_01_flag_bool.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/vendor/clap/examples/tutorial_derive/03_01_flag_bool.rs b/vendor/clap/examples/tutorial_derive/03_01_flag_bool.rs
new file mode 100644
index 000000000..4f68fc834
--- /dev/null
+++ b/vendor/clap/examples/tutorial_derive/03_01_flag_bool.rs
@@ -0,0 +1,14 @@
+use clap::Parser;
+
+#[derive(Parser)]
+#[command(author, version, about, long_about = None)]
+struct Cli {
+ #[arg(short, long)]
+ verbose: bool,
+}
+
+fn main() {
+ let cli = Cli::parse();
+
+ println!("verbose: {:?}", cli.verbose);
+}