docs(Z-flags): Add description for each -Z flag in cargo -Z help
authorKlaus Purer <klaus.purer@gmail.com>
Fri, 30 Mar 2018 15:21:13 +0000 (17:21 +0200)
committerKlaus Purer <klaus.purer@gmail.com>
Fri, 30 Mar 2018 15:21:13 +0000 (17:21 +0200)
src/bin/cli.rs

index da5f4eb59e7196baa6ac42275d6d3d6081563e93..ed5c4805d011c71b100f67627bd16a9c01d48ecd 100644 (file)
@@ -10,6 +10,24 @@ use command_prelude::*;
 
 pub fn main(config: &mut Config) -> CliResult {
     let args = cli().get_matches_safe()?;
+
+    if args.value_of("unstable-features") == Some("help") {
+        println!(
+            "
+Available unstable (nightly-only) flags:
+
+    -Z avoid-dev-deps    -- Avoid installing dev-dependencies if possible
+    -Z minimal-versions  -- Install minimal dependency versions instead of maximum
+    -Z no-index-update   -- Do not update the registry, avoids a network request for benchmarking
+    -Z offline           -- Offline mode that does not perform network requests
+    -Z print-im-a-teapot -- Example option for demonstration purposes
+    -Z unstable-options  -- Allow the usage of unstable options such as --registry
+
+Run with 'cargo -Z [FLAG] [SUBCOMMAND]'"
+        );
+        return Ok(());
+    }
+
     let is_verbose = args.occurrences_of("verbose") > 0;
     if args.is_present("version") {
         let version = cargo::version();
@@ -161,7 +179,7 @@ See 'cargo help <command>' for more information on a specific command.\n",
         .arg(opt("locked", "Require Cargo.lock is up to date").global(true))
         .arg(
             Arg::with_name("unstable-features")
-                .help("Unstable (nightly-only) flags to Cargo")
+                .help("Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details")
                 .short("Z")
                 .value_name("FLAG")
                 .multiple(true)