aboutsummaryrefslogtreecommitdiff
path: root/structopt/examples/no_version.rs
diff options
context:
space:
mode:
Diffstat (limited to 'structopt/examples/no_version.rs')
-rw-r--r--structopt/examples/no_version.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/structopt/examples/no_version.rs b/structopt/examples/no_version.rs
new file mode 100644
index 0000000..a542ec1
--- /dev/null
+++ b/structopt/examples/no_version.rs
@@ -0,0 +1,17 @@
+//! How to completely remove version.
+
+use structopt::clap::AppSettings;
+use structopt::StructOpt;
+
+#[derive(StructOpt, Debug)]
+#[structopt(
+ name = "no_version",
+ no_version,
+ global_settings = &[AppSettings::DisableVersion]
+)]
+struct Opt {}
+
+fn main() {
+ let opt = Opt::from_args();
+ println!("{:?}", opt);
+}