Skip to content

Commit 82636e8

Browse files
Add d as an alias for doc
1 parent 18f2598 commit 82636e8

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

src/bin/cargo/cli.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ Some common cargo commands are (see all commands with --list):
319319
build, b Compile the current package
320320
check, c Analyze the current package and report errors, but don't build object files
321321
clean Remove the target directory
322-
doc Build this package's and its dependencies' documentation
322+
doc, d Build this package's and its dependencies' documentation
323323
new Create a new cargo package
324324
init Create a new cargo package in an existing directory
325325
run, r Run a binary or example of the local package

src/bin/cargo/commands/doc.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ use cargo::ops::{self, DocOptions};
44

55
pub fn cli() -> App {
66
subcommand("doc")
7+
// subcommand aliases are handled in aliased_command()
8+
// .alias("d")
79
.about("Build a package's documentation")
810
.arg(opt("quiet", "No output printed to stdout").short("q"))
911
.arg(opt(

src/bin/cargo/main.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,10 @@ fn main() {
4848

4949
/// Table for defining the aliases which come builtin in `Cargo`.
5050
/// The contents are structured as: `(alias, aliased_command, description)`.
51-
const BUILTIN_ALIASES: [(&str, &str, &str); 4] = [
51+
const BUILTIN_ALIASES: [(&str, &str, &str); 5] = [
5252
("b", "build", "alias: build"),
5353
("c", "check", "alias: check"),
54+
("d", "doc", "alias: doc"),
5455
("r", "run", "alias: run"),
5556
("t", "test", "alias: test"),
5657
];

0 commit comments

Comments
 (0)