Skip to content

Commit

Permalink
Merge pull request clap-rs#4154 from epage/help
Browse files Browse the repository at this point in the history
docs: Fix up for changing of help output
  • Loading branch information
epage committed Aug 31, 2022
2 parents a19c2f5 + 3f44dc0 commit c2f9ecd
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 47 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Expand Up @@ -46,7 +46,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Removed lifetimes from `Command`, `Arg`, `ArgGroup`, and `PossibleValue`
- *(help)* Make `DeriveDisplayOrder` the default and removed the setting. To sort help, set `next_display_order(None)` (#2808)
- *(help)* Subcommand display order respects `Command::next_display_order` instead of `DeriveDisplayOrder` and using its own initial display order value (#2808)
- *(help)* Help headings are now title cased, making any user-provided help headings inconsistent
- *(help)* Help headings are now title cased, making any user-provided help headings inconsistent. To get the old behavior, see `Command::help_template`, `Arg::help_heading`, and `Command::subcommand_help_heading`
- *(env)* Parse `--help` and `--version` like any `ArgAction::SetTrue` flag (#3776)
- *(derive)* Changed the default for arguments from `parse` to `value_parser`., removing `parse` support
- *(derive)* `subcommand_required(true).arg_required_else_help(true)` is set instead of `SubcommandRequiredElseHelp` (#3280)
Expand Down
42 changes: 21 additions & 21 deletions src/builder/arg.rs
Expand Up @@ -1072,10 +1072,10 @@ impl Arg {
/// ```text
/// valnames
///
/// USAGE:
/// Usage:
/// valnames [OPTIONS]
///
/// OPTIONS:
/// Options:
/// --config <FILE> Some help text
/// -h, --help Print help information
/// -V, --version Print version information
Expand Down Expand Up @@ -1129,10 +1129,10 @@ impl Arg {
/// ```text
/// valnames
///
/// USAGE:
/// Usage:
/// valnames [OPTIONS]
///
/// OPTIONS:
/// Options:
/// -h, --help Print help information
/// --io-files <INFILE> <OUTFILE> Some help text
/// -V, --version Print version information
Expand Down Expand Up @@ -1910,10 +1910,10 @@ impl Arg {
/// ```notrust
/// helptest
///
/// USAGE:
/// Usage:
/// helptest [OPTIONS]
///
/// OPTIONS:
/// Options:
/// --config Some help text describing the --config arg
/// -h, --help Print help information
/// -V, --version Print version information
Expand Down Expand Up @@ -1964,10 +1964,10 @@ impl Arg {
/// ```text
/// prog
///
/// USAGE:
/// Usage:
/// prog [OPTIONS]
///
/// OPTIONS:
/// Options:
/// --config
/// The config file used by the myprog must be in JSON format
/// with only valid keys and may not contain other nonsense
Expand Down Expand Up @@ -2030,10 +2030,10 @@ impl Arg {
/// ```text
/// cust-ord
///
/// USAGE:
/// Usage:
/// cust-ord [OPTIONS]
///
/// OPTIONS:
/// Options:
/// -h, --help Print help information
/// -V, --version Print version information
/// -O, --other-option <b> I should be first!
Expand Down Expand Up @@ -2090,10 +2090,10 @@ impl Arg {
/// ```text
/// nlh
///
/// USAGE:
/// Usage:
/// nlh [OPTIONS]
///
/// OPTIONS:
/// Options:
/// -h, --help Print help information
/// -V, --version Print version information
/// -o, --long-option-flag <value1> <value2>
Expand Down Expand Up @@ -2136,10 +2136,10 @@ impl Arg {
/// ```text
/// helptest
///
/// USAGE:
/// Usage:
/// helptest [OPTIONS]
///
/// OPTIONS:
/// Options:
/// -h, --help Print help information
/// -V, --version Print version information
/// ```
Expand Down Expand Up @@ -2310,10 +2310,10 @@ impl Arg {
/// ```text
/// helptest
///
/// USAGE:
/// Usage:
/// helptest [OPTIONS]
///
/// OPTIONS:
/// Options:
/// -h, --help Print help information
/// -V, --version Print version information
/// ```
Expand All @@ -2337,10 +2337,10 @@ impl Arg {
/// ```text
/// helptest
///
/// USAGE:
/// Usage:
/// helptest [OPTIONS]
///
/// OPTIONS:
/// Options:
/// --config Some help text describing the --config arg
/// -h, --help Print help information
/// -V, --version Print version information
Expand Down Expand Up @@ -2383,10 +2383,10 @@ impl Arg {
/// ```text
/// helptest
///
/// USAGE:
/// Usage:
/// helptest [OPTIONS]
///
/// OPTIONS:
/// Options:
/// -h, --help Print help information
/// -V, --version Print version information
/// ```
Expand All @@ -2410,7 +2410,7 @@ impl Arg {
/// ```text
/// helptest
///
/// USAGE:
/// Usage:
/// helptest [OPTIONS]
///
/// OPTIONS:
Expand Down
50 changes: 25 additions & 25 deletions src/builder/command.rs
Expand Up @@ -1660,7 +1660,7 @@ impl Command {
/// Does awesome things\n\
/// (C) me@mail.com\n\n\
///
/// USAGE: myapp <opts> <command>\n\n\
/// Usage: myapp <opts> <command>\n\n\
///
/// Options:\n\
/// -h, --help Display this message\n\
Expand Down Expand Up @@ -1769,7 +1769,7 @@ impl Command {
///
/// This will be used for any arg that hasn't had [`Arg::help_heading`] called.
///
/// This is useful if the default `OPTIONS` or `ARGS` headings are
/// This is useful if the default `Options` or `Arguments` headings are
/// not specific enough for one's use case.
///
/// For subcommands, see [`Command::subcommand_help_heading`]
Expand Down Expand Up @@ -2585,16 +2585,16 @@ impl Command {
/// ```text
/// cust-ord
///
/// USAGE:
/// Usage:
/// cust-ord [OPTIONS]
///
/// OPTIONS:
/// -h, --help Print help information
/// -V, --version Print version information
///
/// SUBCOMMANDS:
/// Subcommands:
/// beta I should be first!
/// alpha Some help and text
///
/// Options:
/// -h, --help Print help information
/// -V, --version Print version information
/// ```
#[inline]
#[must_use]
Expand Down Expand Up @@ -3053,16 +3053,16 @@ impl Command {
/// ```text
/// myprog
///
/// USAGE:
/// Usage:
/// myprog [SUBCOMMAND]
///
/// OPTIONS:
/// -h, --help Print help information
/// -V, --version Print version information
///
/// SUBCOMMANDS:
/// Subcommands:
/// help Print this message or the help of the given subcommand(s)
/// sub1
///
/// Options:
/// -h, --help Print help information
/// -V, --version Print version information
/// ```
///
/// but usage of `subcommand_value_name`
Expand All @@ -3081,14 +3081,14 @@ impl Command {
/// ```text
/// myprog
///
/// USAGE:
/// Usage:
/// myprog [THING]
///
/// OPTIONS:
/// Options:
/// -h, --help Print help information
/// -V, --version Print version information
///
/// SUBCOMMANDS:
/// Subcommands:
/// help Print this message or the help of the given subcommand(s)
/// sub1
/// ```
Expand All @@ -3100,7 +3100,7 @@ impl Command {

/// Sets the help heading used for subcommands when printing usage and help.
///
/// By default, this is "SUBCOMMANDS".
/// By default, this is "Subcommands".
///
/// See also [`Command::subcommand_value_name`]
///
Expand All @@ -3119,14 +3119,14 @@ impl Command {
/// ```text
/// myprog
///
/// USAGE:
/// Usage:
/// myprog [SUBCOMMAND]
///
/// OPTIONS:
/// Options:
/// -h, --help Print help information
/// -V, --version Print version information
///
/// SUBCOMMANDS:
/// Subcommands:
/// help Print this message or the help of the given subcommand(s)
/// sub1
/// ```
Expand All @@ -3137,7 +3137,7 @@ impl Command {
/// # use clap::{Command, Arg};
/// Command::new("myprog")
/// .subcommand(Command::new("sub1"))
/// .subcommand_help_heading("THINGS")
/// .subcommand_help_heading("Things")
/// .print_help()
/// # ;
/// ```
Expand All @@ -3147,14 +3147,14 @@ impl Command {
/// ```text
/// myprog
///
/// USAGE:
/// Usage:
/// myprog [SUBCOMMAND]
///
/// OPTIONS:
/// Options:
/// -h, --help Print help information
/// -V, --version Print version information
///
/// THINGS:
/// Things:
/// help Print this message or the help of the given subcommand(s)
/// sub1
/// ```
Expand Down

0 comments on commit c2f9ecd

Please sign in to comment.