aboutsummaryrefslogtreecommitdiff
path: root/examples/required_if.rs
diff options
context:
space:
mode:
Diffstat (limited to 'examples/required_if.rs')
-rw-r--r--examples/required_if.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/examples/required_if.rs b/examples/required_if.rs
index cb6b414..e3497b2 100644
--- a/examples/required_if.rs
+++ b/examples/required_if.rs
@@ -1,4 +1,23 @@
//! How to use `required_if` with structopt.
+//!
+//! Running this example with --help prints this message:
+//! -----------------------------------------------------
+//! structopt 0.3.25
+//!
+//! USAGE:
+//! required_if -o <out-type> [FILE]
+//!
+//! FLAGS:
+//! -h, --help Prints help information
+//! -V, --version Prints version information
+//!
+//! OPTIONS:
+//! -o <out-type> Where to write the output: to `stdout` or `file`
+//!
+//! ARGS:
+//! <FILE> File name: only required when `out-type` is set to `file`
+//! -----------------------------------------------------
+
use structopt::StructOpt;
#[derive(Debug, StructOpt, PartialEq)]