note about optional subcommands

This commit is contained in:
William Yao 2017-07-03 14:22:17 -05:00 committed by Guillaume P
parent a8e466c7bb
commit 12e88e1ea8

View file

@ -181,6 +181,25 @@
//! + `make-cookie pound 50`
//! + `make-cookie sparkle -mmm --color "green"`
//! + `make-cookie finish 130 glaze 3`
//!
//! ### Optional subcommands
//!
//! A nested subcommand can be marked optional:
//!
//! #[derive(StructOpt)]
//! #[structopt(name = "foo")]
//! struct Foo {
//! file: String,
//! #[structopt(subcommand)]
//! cmd: Option<Command>
//! }
//!
//! #[derive(StructOpt)]
//! enum Command {
//! Bar {},
//! Baz {},
//! Quux {}
//! }
extern crate proc_macro;
extern crate syn;