summaryrefslogtreecommitdiffstats
path: root/vendor/clap-3.2.20/examples/tutorial_derive/02_crate.rs
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/clap-3.2.20/examples/tutorial_derive/02_crate.rs')
-rw-r--r--vendor/clap-3.2.20/examples/tutorial_derive/02_crate.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/vendor/clap-3.2.20/examples/tutorial_derive/02_crate.rs b/vendor/clap-3.2.20/examples/tutorial_derive/02_crate.rs
new file mode 100644
index 000000000..5576f998c
--- /dev/null
+++ b/vendor/clap-3.2.20/examples/tutorial_derive/02_crate.rs
@@ -0,0 +1,17 @@
+use clap::Parser;
+
+#[derive(Parser)]
+#[clap(author, version, about, long_about = None)] // Read from `Cargo.toml`
+struct Cli {
+ #[clap(long, value_parser)]
+ two: String,
+ #[clap(long, value_parser)]
+ one: String,
+}
+
+fn main() {
+ let cli = Cli::parse();
+
+ println!("two: {:?}", cli.two);
+ println!("one: {:?}", cli.one);
+}