Skip to content

Commit

Permalink
docs: updates docs to new version flag defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
kbknapp committed Jun 17, 2015
1 parent b2fab46 commit ebf442e
Show file tree
Hide file tree
Showing 8 changed files with 114 additions and 112 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ USAGE:
FLAGS:
-d Turn debugging information on
-h, --help Prints this message
-v, --version Prints version information
-V, --version Prints version information

OPTIONS:
-c, --config <CONFIG> Sets a custom config file
Expand Down Expand Up @@ -369,6 +369,7 @@ There are a few goals of `clap` that I'd like to maintain throughout contributio

Although I do my best to keep breaking changes to a minimum, being that this a sub 1.0 library, there are breaking changes from time to time in order to support better features or implementation. For the full details see the changelog.md

* As of 0.11.0: The default short flag for `version` has changed from `-v` to `-V` (Uppercase). Although you can also now override the short flag for `help` and `version` using `App::help_short()` and `App::version_short()`
* As of 0.7.0
- `Arg::possible_values()`, `Arg::value_names()`, `Arg::requires_all()`, `Arg::mutually_excludes_all()` [deprecated], `Arg::conflicts_with_all()`
+ No longer take a `Vec<&str>`, instead they take a generic `IntoIterator<Item=AsRef<str>>` which means you cannot use an inline `vec![]` but it means the methods are now far more flexible, especially for dynamic value generation.
Expand Down
4 changes: 2 additions & 2 deletions examples/01a_QuickExample.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ fn main() {
// - A help flag (automatically generated by clap)
// + Uses "-h" or "--help" (Only autogenerated if you do NOT specify your own "-h" or "--help")
// - A version flag (automatically generated by clap)
// + Uses "-v" or "--version" (Only autogenerated if you do NOT specify your own "-v" or "--version")
// + Uses "-V" or "--version" (Only autogenerated if you do NOT specify your own "-V" or "--version")
// - A subcommand "test" (subcommands behave like their own apps, with their own arguments
// + Used by "$ myapp test" with the following arguments
// > A list flag
// = Uses "-l" (usage is "$ myapp test -l"
// > A help flag (automatically generated by clap
// = Uses "-h" or "--help" (full usage "$ myapp test -h" or "$ myapp test --help")
// > A version flag (automatically generated by clap
// = Uses "-v" or "--version" (full usage "$ myapp test -v" or "$ myapp test --version")
// = Uses "-V" or "--version" (full usage "$ myapp test -V" or "$ myapp test --version")
// - A subcommand "help" (automatically generated by clap because we specified a subcommand of our own)
// + Used by "$ myapp help" (same functionality as "-h" or "--help")
let matches = App::new("MyApp")
Expand Down
4 changes: 2 additions & 2 deletions examples/01b_QuickExample.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ fn main() {
// - A help flag (automatically generated by clap)
// + Uses "-h" or "--help" (Only autogenerated if you do NOT specify your own "-h" or "--help")
// - A version flag (automatically generated by clap)
// + Uses "-v" or "--version" (Only autogenerated if you do NOT specify your own "-v" or "--version")
// + Uses "-V" or "--version" (Only autogenerated if you do NOT specify your own "-V" or "--version")
// - A subcommand "test" (subcommands behave like their own apps, with their own arguments
// + Used by "$ myapp test" with the following arguments
// > A list flag
// = Uses "-l" (usage is "$ myapp test -l"
// > A help flag (automatically generated by clap
// = Uses "-h" or "--help" (full usage "$ myapp test -h" or "$ myapp test --help")
// > A version flag (automatically generated by clap
// = Uses "-v" or "--version" (full usage "$ myapp test -v" or "$ myapp test --version")
// = Uses "-V" or "--version" (full usage "$ myapp test -V" or "$ myapp test --version")
// - A subcommand "help" (automatically generated by clap because we specified a subcommand of our own)
// + Used by "$ myapp help" (same functionality as "-h" or "--help")
let matches = App::new("MyApp")
Expand Down
2 changes: 1 addition & 1 deletion examples/02_Apps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ fn main() {
.about("Does awesome things")
.get_matches();

// This example doesn't do much, but it *does* give automatic -h, --help, -v, and --version functionality ;)
// This example doesn't do much, but it *does* give automatic -h, --help, -V, and --version functionality ;)

// Continued program logic goes here...
}
4 changes: 2 additions & 2 deletions examples/03_Args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ fn main() {
//
// # Help and Version
// clap automatically generates a help and version flag for you, unless you specificy your
// own. By default help uses "-h" and "--help", and version uses "-v" and "--version". You can
// safely overide "-v" and "-h" to your own arguments, and "--help" and "--version" will stil
// own. By default help uses "-h" and "--help", and version uses "-V" and "--version". You can
// safely overide "-V" and "-h" to your own arguments, and "--help" and "--version" will stil
// be automatically generated for you.
let matches = App::new("MyApp")
// All application settings go here...
Expand Down
2 changes: 1 addition & 1 deletion examples/08_SubCommands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ fn main() {
//
// # Help and Version
// Just like Apps, each subcommand will get it's own "help" and "version" flags automatically
// generated. Also, like Apps, you can override "-v" or "-h" safely and still get "--help" and
// generated. Also, like Apps, you can override "-V" or "-h" safely and still get "--help" and
// "--version" auto generated.
//
// NOTE: If you specify a subcommand for your App, clap will also autogenerate a "help"
Expand Down
4 changes: 2 additions & 2 deletions examples/09_AutoVersion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ fn main() {
.version(&crate_version!()[..])
.get_matches();

// running the this app with the -v or --version will display whatever version is in your
// running the this app with the -V or --version will display whatever version is in your
// Cargo.toml, the default being: myapp 0.0.1
}
}
Loading

0 comments on commit ebf442e

Please sign in to comment.