Skip to content

Commit 30e959c

Browse files
committed
refactor(cli): move augment_subcommands() to the end
1 parent 9f33002 commit 30e959c

File tree

1 file changed

+14
-17
lines changed

1 file changed

+14
-17
lines changed

src/cli/rustup_mode.rs

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -457,11 +457,7 @@ pub(crate) fn cli() -> Command {
457457
Command::new("dump-testament")
458458
.about("Dump information about the build")
459459
.hide(true), // Not for users, only CI
460-
);
461-
462-
app = RustupSubcmd::augment_subcommands(app);
463-
464-
app = app
460+
)
465461
.subcommand(Command::new("check").about("Check for updates to Rust toolchains and rustup"))
466462
.subcommand(
467463
Command::new("default")
@@ -762,20 +758,21 @@ pub(crate) fn cli() -> Command {
762758
.default_value(SelfUpdateMode::default_mode()),
763759
),
764760
),
761+
)
762+
.subcommand(
763+
Command::new("completions")
764+
.about("Generate tab-completion scripts for your shell")
765+
.after_help(COMPLETIONS_HELP)
766+
.arg_required_else_help(true)
767+
.arg(Arg::new("shell").value_parser(EnumValueParser::<Shell>::new()))
768+
.arg(
769+
Arg::new("command")
770+
.value_parser(EnumValueParser::<CompletionCommand>::new())
771+
.default_missing_value("rustup"),
772+
),
765773
);
766774

767-
app.subcommand(
768-
Command::new("completions")
769-
.about("Generate tab-completion scripts for your shell")
770-
.after_help(COMPLETIONS_HELP)
771-
.arg_required_else_help(true)
772-
.arg(Arg::new("shell").value_parser(EnumValueParser::<Shell>::new()))
773-
.arg(
774-
Arg::new("command")
775-
.value_parser(EnumValueParser::<CompletionCommand>::new())
776-
.default_missing_value("rustup"),
777-
),
778-
)
775+
RustupSubcmd::augment_subcommands(app)
779776
}
780777

781778
fn verbose_arg(help: &'static str) -> Arg {

0 commit comments

Comments
 (0)