Skip to content

Commit

Permalink
refactor(cli): move augment_subcommands() to the end
Browse files Browse the repository at this point in the history
  • Loading branch information
rami3l committed Jan 21, 2024
1 parent 9f33002 commit 30e959c
Showing 1 changed file with 14 additions and 17 deletions.
31 changes: 14 additions & 17 deletions src/cli/rustup_mode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -457,11 +457,7 @@ pub(crate) fn cli() -> Command {
Command::new("dump-testament")
.about("Dump information about the build")
.hide(true), // Not for users, only CI
);

app = RustupSubcmd::augment_subcommands(app);

app = app
)
.subcommand(Command::new("check").about("Check for updates to Rust toolchains and rustup"))
.subcommand(
Command::new("default")
Expand Down Expand Up @@ -762,20 +758,21 @@ pub(crate) fn cli() -> Command {
.default_value(SelfUpdateMode::default_mode()),
),
),
)
.subcommand(
Command::new("completions")
.about("Generate tab-completion scripts for your shell")
.after_help(COMPLETIONS_HELP)
.arg_required_else_help(true)
.arg(Arg::new("shell").value_parser(EnumValueParser::<Shell>::new()))
.arg(
Arg::new("command")
.value_parser(EnumValueParser::<CompletionCommand>::new())
.default_missing_value("rustup"),
),
);

app.subcommand(
Command::new("completions")
.about("Generate tab-completion scripts for your shell")
.after_help(COMPLETIONS_HELP)
.arg_required_else_help(true)
.arg(Arg::new("shell").value_parser(EnumValueParser::<Shell>::new()))
.arg(
Arg::new("command")
.value_parser(EnumValueParser::<CompletionCommand>::new())
.default_missing_value("rustup"),
),
)
RustupSubcmd::augment_subcommands(app)
}

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

0 comments on commit 30e959c

Please sign in to comment.