Skip to content

Commit

Permalink
Add documentation for env
Browse files Browse the repository at this point in the history
  • Loading branch information
vmalloc committed Jul 15, 2019
1 parent 119dd7e commit 2020de1
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,23 @@
//! # fn main() {}
//! ```
//!
//! ## Environment Variable Fallback
//!
//! It is possible to specify an environment variable fallback option for arguments, so that their value is taken
//! from the specified environment variables if not given through the command-line:
//!
//! ```
//! # use structopt::StructOpt;
//!
//! #[derive(StructOpt)]
//! #[structopt(name = "foo")]
//! struct Foo {
//! #[structopt(short = "p", long = "param", env = "PARAMETER_VALUE")]
//! param: String
//! }
//! # fn main() {}
//! ```
//!
//! ## Subcommands
//!
//! Some applications, especially large ones, split their functionality
Expand Down

0 comments on commit 2020de1

Please sign in to comment.