fix: Switch sub-commands from multi-val to multi-occur

Similar to #2977, this changes positional argument `<subcmd>` in
`help <subcmd>` to be multiple occurrences, from being multiple values.

This is what identified the usage generation bug fixed in #2978 and was
isolated into the test case `positional_multiple_occurrences_is_dotted`.

This is part of #2692 where we re-evaluate the usage of multiple values
for positionals now that we accept multiple occurrences.
This commit is contained in:
Ed Page 2021-10-30 13:42:01 -05:00
parent acaa3645c3
commit 8212647bb3

View file

@ -923,7 +923,7 @@ impl<'help, 'app> Parser<'help, 'app> {
let pb = Arg::new("subcommand") let pb = Arg::new("subcommand")
.index(1) .index(1)
.setting(ArgSettings::TakesValue) .setting(ArgSettings::TakesValue)
.setting(ArgSettings::MultipleValues) .setting(ArgSettings::MultipleOccurrences)
.value_name("SUBCOMMAND") .value_name("SUBCOMMAND")
.about("The subcommand whose help message to display"); .about("The subcommand whose help message to display");
sc = sc.arg(pb); sc = sc.arg(pb);