]> git.proxmox.com Git - cargo.git/commitdiff
Make help command accept -h and --help
authorMatthew Hall <matthew@quickbeam.me.uk>
Wed, 29 Oct 2014 12:28:52 +0000 (12:28 +0000)
committerMatthew Hall <matthew@quickbeam.me.uk>
Wed, 29 Oct 2014 12:28:52 +0000 (12:28 +0000)
src/bin/cargo.rs

index f243689d34d6a11ccd869fd54a984515fc056337..d82d297abce2f1af64425e45a87566106b7ace3d 100644 (file)
@@ -106,6 +106,9 @@ fn execute(flags: Flags, shell: &mut MultiShell) -> CliResult<Option<()>> {
             cargo::process_executed(r, shell);
             return Ok(None)
         }
+        "help" if flags.arg_args[0].as_slice() == "-h" ||
+                  flags.arg_args[0].as_slice() == "--help" =>
+            (flags.arg_args, "help"),
         "help" => (vec!["-h".to_string()], flags.arg_args[0].as_slice()),
         s => (flags.arg_args.clone(), s),
     };