@@ -214,10 +214,7 @@ pub(crate) fn cli() -> App<'static, 'static> {
214
214
. setting ( AppSettings :: DeriveDisplayOrder )
215
215
. setting ( AppSettings :: SubcommandRequiredElseHelp )
216
216
. arg (
217
- Arg :: with_name ( "verbose" )
218
- . help ( "Enable verbose output" )
219
- . short ( "v" )
220
- . long ( "verbose" ) ,
217
+ verbose_arg ( "Enable verbose output" ) ,
221
218
)
222
219
. arg (
223
220
Arg :: with_name ( "quiet" )
@@ -253,11 +250,7 @@ pub(crate) fn cli() -> App<'static, 'static> {
253
250
. about ( "Show the active toolchain" )
254
251
. after_help ( SHOW_ACTIVE_TOOLCHAIN_HELP )
255
252
. arg (
256
- Arg :: with_name ( "verbose" )
257
- . help ( "Enable verbose output with rustc information" )
258
- . takes_value ( false )
259
- . short ( "v" )
260
- . long ( "verbose" ) ,
253
+ verbose_arg ( "Enable verbose output with rustc information" ) ,
261
254
) ,
262
255
)
263
256
. subcommand (
@@ -360,11 +353,7 @@ pub(crate) fn cli() -> App<'static, 'static> {
360
353
SubCommand :: with_name ( "list" )
361
354
. about ( "List installed toolchains" )
362
355
. arg (
363
- Arg :: with_name ( "verbose" )
364
- . help ( "Enable verbose output with toolchain information" )
365
- . takes_value ( false )
366
- . short ( "v" )
367
- . long ( "verbose" ) ,
356
+ verbose_arg ( "Enable verbose output with toolchain information" ) ,
368
357
) ,
369
358
)
370
359
. subcommand (
@@ -746,6 +735,14 @@ pub(crate) fn cli() -> App<'static, 'static> {
746
735
)
747
736
}
748
737
738
+ fn verbose_arg < ' a , ' b > ( help : & ' b str ) -> Arg < ' a , ' b > {
739
+ Arg :: with_name ( "verbose" )
740
+ . help ( help)
741
+ . takes_value ( false )
742
+ . short ( "v" )
743
+ . long ( "verbose" )
744
+ }
745
+
749
746
fn maybe_upgrade_data ( cfg : & Cfg , m : & ArgMatches < ' _ > ) -> Result < bool > {
750
747
match m. subcommand ( ) {
751
748
( "self" , Some ( c) ) => match c. subcommand ( ) {
0 commit comments