diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b51327198e..1b2dff5c9b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/src/builder/arg.rs b/src/builder/arg.rs index f226861bd81..08195523d5d 100644 --- a/src/builder/arg.rs +++ b/src/builder/arg.rs @@ -1072,10 +1072,10 @@ impl Arg { /// ```text /// valnames /// - /// USAGE: + /// Usage: /// valnames [OPTIONS] /// - /// OPTIONS: + /// Options: /// --config Some help text /// -h, --help Print help information /// -V, --version Print version information @@ -1129,10 +1129,10 @@ impl Arg { /// ```text /// valnames /// - /// USAGE: + /// Usage: /// valnames [OPTIONS] /// - /// OPTIONS: + /// Options: /// -h, --help Print help information /// --io-files Some help text /// -V, --version Print version information @@ -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 @@ -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 @@ -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 I should be first! @@ -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 @@ -2136,10 +2136,10 @@ impl Arg { /// ```text /// helptest /// - /// USAGE: + /// Usage: /// helptest [OPTIONS] /// - /// OPTIONS: + /// Options: /// -h, --help Print help information /// -V, --version Print version information /// ``` @@ -2310,10 +2310,10 @@ impl Arg { /// ```text /// helptest /// - /// USAGE: + /// Usage: /// helptest [OPTIONS] /// - /// OPTIONS: + /// Options: /// -h, --help Print help information /// -V, --version Print version information /// ``` @@ -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 @@ -2383,10 +2383,10 @@ impl Arg { /// ```text /// helptest /// - /// USAGE: + /// Usage: /// helptest [OPTIONS] /// - /// OPTIONS: + /// Options: /// -h, --help Print help information /// -V, --version Print version information /// ``` @@ -2410,7 +2410,7 @@ impl Arg { /// ```text /// helptest /// - /// USAGE: + /// Usage: /// helptest [OPTIONS] /// /// OPTIONS: diff --git a/src/builder/command.rs b/src/builder/command.rs index a32a7d345a7..e698e554a38 100644 --- a/src/builder/command.rs +++ b/src/builder/command.rs @@ -1660,7 +1660,7 @@ impl Command { /// Does awesome things\n\ /// (C) me@mail.com\n\n\ /// - /// USAGE: myapp \n\n\ + /// Usage: myapp \n\n\ /// /// Options:\n\ /// -h, --help Display this message\n\ @@ -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`] @@ -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] @@ -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` @@ -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 /// ``` @@ -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`] /// @@ -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 /// ``` @@ -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() /// # ; /// ``` @@ -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 /// ```