@@ -1408,6 +1408,10 @@ pub struct RustcOptGroup {
1408
1408
long_name : & ' static str ,
1409
1409
desc : & ' static str ,
1410
1410
value_hint : & ' static str ,
1411
+
1412
+ /// If true, this option should not be printed by `rustc --help`, but
1413
+ /// should still be printed by `rustc --help -v`.
1414
+ pub is_verbose_help_only : bool ,
1411
1415
}
1412
1416
1413
1417
impl RustcOptGroup {
@@ -1447,6 +1451,7 @@ pub fn make_opt(
1447
1451
long_name,
1448
1452
desc,
1449
1453
value_hint,
1454
+ is_verbose_help_only : false ,
1450
1455
}
1451
1456
}
1452
1457
@@ -1457,16 +1462,15 @@ The default is {DEFAULT_EDITION} and the latest stable edition is {LATEST_STABLE
1457
1462
)
1458
1463
} ) ;
1459
1464
1460
- /// Returns the "short" subset of the rustc command line options,
1461
- /// including metadata for each option, such as whether the option is
1462
- /// part of the stable long-term interface for rustc.
1463
- pub fn rustc_short_optgroups ( ) -> Vec < RustcOptGroup > {
1465
+ /// Returns all rustc command line options, including metadata for
1466
+ /// each option, such as whether the option is stable.
1467
+ pub fn rustc_optgroups ( ) -> Vec < RustcOptGroup > {
1464
1468
use OptionKind :: { Flag , FlagMulti , Multi , Opt } ;
1465
- use OptionStability :: Stable ;
1469
+ use OptionStability :: { Stable , Unstable } ;
1466
1470
1467
1471
use self :: make_opt as opt;
1468
1472
1469
- vec ! [
1473
+ let mut options = vec ! [
1470
1474
opt( Stable , Flag , "h" , "help" , "Display this message" , "" ) ,
1471
1475
opt(
1472
1476
Stable ,
@@ -1553,21 +1557,11 @@ pub fn rustc_short_optgroups() -> Vec<RustcOptGroup> {
1553
1557
opt( Stable , Multi , "C" , "codegen" , "Set a codegen option" , "OPT[=VALUE]" ) ,
1554
1558
opt( Stable , Flag , "V" , "version" , "Print version info and exit" , "" ) ,
1555
1559
opt( Stable , Flag , "v" , "verbose" , "Use verbose output" , "" ) ,
1556
- ]
1557
- }
1558
-
1559
- /// Returns all rustc command line options, including metadata for
1560
- /// each option, such as whether the option is part of the stable
1561
- /// long-term interface for rustc.
1562
- pub fn rustc_optgroups ( ) -> Vec < RustcOptGroup > {
1563
- use OptionKind :: { Multi , Opt } ;
1564
- use OptionStability :: { Stable , Unstable } ;
1565
-
1566
- use self :: make_opt as opt;
1560
+ ] ;
1567
1561
1568
- let mut opts = rustc_short_optgroups ( ) ;
1569
- // FIXME: none of these descriptions are actually used
1570
- opts . extend ( vec ! [
1562
+ // Options in this list are hidden from `rustc --help` by default, but are
1563
+ // shown by `rustc --help -v`.
1564
+ let verbose_only = [
1571
1565
opt (
1572
1566
Stable ,
1573
1567
Multi ,
@@ -1593,9 +1587,9 @@ pub fn rustc_optgroups() -> Vec<RustcOptGroup> {
1593
1587
"" ,
1594
1588
"color" ,
1595
1589
"Configure coloring of output:
1596
- auto = colorize, if output goes to a tty (default);
1597
- always = always colorize output;
1598
- never = never colorize output" ,
1590
+ auto = colorize, if output goes to a tty (default);
1591
+ always = always colorize output;
1592
+ never = never colorize output" ,
1599
1593
"auto|always|never" ,
1600
1594
) ,
1601
1595
opt (
@@ -1615,8 +1609,13 @@ pub fn rustc_optgroups() -> Vec<RustcOptGroup> {
1615
1609
"FROM=TO" ,
1616
1610
) ,
1617
1611
opt ( Unstable , Multi , "" , "env-set" , "Inject an environment variable" , "VAR=VALUE" ) ,
1618
- ] ) ;
1619
- opts
1612
+ ] ;
1613
+ options. extend ( verbose_only. into_iter ( ) . map ( |mut opt| {
1614
+ opt. is_verbose_help_only = true ;
1615
+ opt
1616
+ } ) ) ;
1617
+
1618
+ options
1620
1619
}
1621
1620
1622
1621
pub fn get_cmd_lint_options (
0 commit comments