Skip to content

rustup_mode.rs: Break up CLI generation to let rustfmt work #2097

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 29, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions src/cli/rustup_mode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ pub fn cli() -> App<'static, 'static> {
.subcommand(
SubCommand::with_name("dump-testament")
.about("Dump information about the build")
.setting(AppSettings::Hidden) // Not for users, only CI
.setting(AppSettings::Hidden), // Not for users, only CI
)
.subcommand(
SubCommand::with_name("show")
Expand Down Expand Up @@ -183,13 +183,13 @@ pub fn cli() -> App<'static, 'static> {
.long("profile")
.takes_value(true)
.possible_values(Profile::names())
.required(false)
.required(false),
)
.arg(
Arg::with_name("no-self-update")
.help("Don't perform self-update when running the `rustup install` command")
.long("no-self-update")
.takes_value(false)
.takes_value(false),
)
.arg(
Arg::with_name("force")
Expand Down Expand Up @@ -223,7 +223,7 @@ pub fn cli() -> App<'static, 'static> {
Arg::with_name("no-self-update")
.help("Don't perform self update when running the `rustup update` command")
.long("no-self-update")
.takes_value(false)
.takes_value(false),
)
.arg(
Arg::with_name("force")
Expand All @@ -232,10 +232,7 @@ pub fn cli() -> App<'static, 'static> {
.takes_value(false),
),
)
.subcommand(
SubCommand::with_name("check")
.about("Check for updates to Rust toolchains")
)
.subcommand(SubCommand::with_name("check").about("Check for updates to Rust toolchains"))
.subcommand(
SubCommand::with_name("default")
.about("Set the default toolchain")
Expand All @@ -245,8 +242,11 @@ pub fn cli() -> App<'static, 'static> {
.help(TOOLCHAIN_ARG_HELP)
.required(false),
),
)
.subcommand(
);

// We break the app creation here so that rustfmt can cope
// If rustfmt ceases to format this block, break it up further
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there an issue about that in rustfmt?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is indeed a known issue in rustfmt though I was told it's unlikely to be resolved before 2.0

app = app.subcommand(
SubCommand::with_name("toolchain")
.about("Modify or query the installed toolchains")
.after_help(TOOLCHAIN_HELP)
Expand Down