Skip to content

Commit 47f4b85

Browse files
committed
Set SubcommandRequiredElseHelp correctly
Signed-off-by: hi-rustin <[email protected]>
1 parent 89f1037 commit 47f4b85

File tree

1 file changed

+7
-13
lines changed

1 file changed

+7
-13
lines changed

src/cli/rustup_mode.rs

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ pub(crate) fn cli() -> Command<'static> {
226226
.about("The Rust toolchain installer")
227227
.after_help(RUSTUP_HELP)
228228
.global_setting(AppSettings::DeriveDisplayOrder)
229-
.arg_required_else_help(true)
229+
.setting(AppSettings::SubcommandRequiredElseHelp)
230230
.arg(
231231
verbose_arg("Enable verbose output"),
232232
)
@@ -369,8 +369,7 @@ pub(crate) fn cli() -> Command<'static> {
369369
Command::new("toolchain")
370370
.about("Modify or query the installed toolchains")
371371
.after_help(TOOLCHAIN_HELP)
372-
.subcommand_required(true)
373-
.arg_required_else_help(true)
372+
.setting(AppSettings::SubcommandRequiredElseHelp)
374373
.subcommand(
375374
Command::new("list")
376375
.about("List installed toolchains")
@@ -475,8 +474,7 @@ pub(crate) fn cli() -> Command<'static> {
475474
.subcommand(
476475
Command::new("target")
477476
.about("Modify a toolchain's supported targets")
478-
.subcommand_required(true)
479-
.arg_required_else_help(true)
477+
.setting(AppSettings::SubcommandRequiredElseHelp)
480478
.subcommand(
481479
Command::new("list")
482480
.about("List installed and available targets")
@@ -536,8 +534,7 @@ pub(crate) fn cli() -> Command<'static> {
536534
.subcommand(
537535
Command::new("component")
538536
.about("Modify a toolchain's installed components")
539-
.subcommand_required(true)
540-
.arg_required_else_help(true)
537+
.setting(AppSettings::SubcommandRequiredElseHelp)
541538
.subcommand(
542539
Command::new("list")
543540
.about("List installed and available components")
@@ -593,8 +590,7 @@ pub(crate) fn cli() -> Command<'static> {
593590
Command::new("override")
594591
.about("Modify directory toolchain overrides")
595592
.after_help(OVERRIDE_HELP)
596-
.subcommand_required(true)
597-
.arg_required_else_help(true)
593+
.setting(AppSettings::SubcommandRequiredElseHelp)
598594
.subcommand(
599595
Command::new("list").about("List directory toolchain overrides"),
600596
)
@@ -722,8 +718,7 @@ pub(crate) fn cli() -> Command<'static> {
722718
.subcommand(
723719
Command::new("self")
724720
.about("Modify the rustup installation")
725-
.subcommand_required(true)
726-
.arg_required_else_help(true)
721+
.setting(AppSettings::SubcommandRequiredElseHelp)
727722
.subcommand(Command::new("update").about("Download and install updates to rustup"))
728723
.subcommand(
729724
Command::new("uninstall")
@@ -737,8 +732,7 @@ pub(crate) fn cli() -> Command<'static> {
737732
.subcommand(
738733
Command::new("set")
739734
.about("Alter rustup settings")
740-
.subcommand_required(true)
741-
.arg_required_else_help(true)
735+
.setting(AppSettings::SubcommandRequiredElseHelp)
742736
.subcommand(
743737
Command::new("default-host")
744738
.about("The triple used to identify toolchains when not specified")

0 commit comments

Comments
 (0)