Skip to content

Commit 8da646c

Browse files
authored
Merge pull request #2097 from kinnison/kinnison/format-cli-more
rustup_mode.rs: Break up CLI generation to let rustfmt work
2 parents 7dddda4 + 0691c37 commit 8da646c

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/cli/rustup_mode.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ pub fn cli() -> App<'static, 'static> {
148148
.subcommand(
149149
SubCommand::with_name("dump-testament")
150150
.about("Dump information about the build")
151-
.setting(AppSettings::Hidden) // Not for users, only CI
151+
.setting(AppSettings::Hidden), // Not for users, only CI
152152
)
153153
.subcommand(
154154
SubCommand::with_name("show")
@@ -183,13 +183,13 @@ pub fn cli() -> App<'static, 'static> {
183183
.long("profile")
184184
.takes_value(true)
185185
.possible_values(Profile::names())
186-
.required(false)
186+
.required(false),
187187
)
188188
.arg(
189189
Arg::with_name("no-self-update")
190190
.help("Don't perform self-update when running the `rustup install` command")
191191
.long("no-self-update")
192-
.takes_value(false)
192+
.takes_value(false),
193193
)
194194
.arg(
195195
Arg::with_name("force")
@@ -223,7 +223,7 @@ pub fn cli() -> App<'static, 'static> {
223223
Arg::with_name("no-self-update")
224224
.help("Don't perform self update when running the `rustup update` command")
225225
.long("no-self-update")
226-
.takes_value(false)
226+
.takes_value(false),
227227
)
228228
.arg(
229229
Arg::with_name("force")
@@ -232,10 +232,7 @@ pub fn cli() -> App<'static, 'static> {
232232
.takes_value(false),
233233
),
234234
)
235-
.subcommand(
236-
SubCommand::with_name("check")
237-
.about("Check for updates to Rust toolchains")
238-
)
235+
.subcommand(SubCommand::with_name("check").about("Check for updates to Rust toolchains"))
239236
.subcommand(
240237
SubCommand::with_name("default")
241238
.about("Set the default toolchain")
@@ -245,8 +242,11 @@ pub fn cli() -> App<'static, 'static> {
245242
.help(TOOLCHAIN_ARG_HELP)
246243
.required(false),
247244
),
248-
)
249-
.subcommand(
245+
);
246+
247+
// We break the app creation here so that rustfmt can cope
248+
// If rustfmt ceases to format this block, break it up further
249+
app = app.subcommand(
250250
SubCommand::with_name("toolchain")
251251
.about("Modify or query the installed toolchains")
252252
.after_help(TOOLCHAIN_HELP)

0 commit comments

Comments
 (0)