Skip to content

Commit

Permalink
Rollup merge of #87362 - inquisitivecrystal:bootstrap-doc, r=jyn514
Browse files Browse the repository at this point in the history
Make `x.py d` an alias for `x.py doc`

In rust-lang/cargo#9680, `d` was added to Cargo as an alias for `doc`. This PR adds the same alias to `x.py`. The same considerations of convenience that applied to Cargo also apply to `x.py`, and in any case, the two should be kept symmetrical.
  • Loading branch information
JohnTitor authored Jul 23, 2021
2 parents 377bb73 + a60f627 commit a247257
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/bootstrap/flags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ Subcommands:
fmt Run rustfmt
test, t Build and run some test suites
bench Build and run some benchmarks
doc Build documentation
doc, d Build documentation
clean Clean out build directories
dist Build distribution artifacts
install Install distribution artifacts
Expand Down Expand Up @@ -244,6 +244,7 @@ To learn more about a subcommand, run `./x.py <subcommand> -h`",
|| (s == "t")
|| (s == "bench")
|| (s == "doc")
|| (s == "d")
|| (s == "clean")
|| (s == "dist")
|| (s == "install")
Expand Down Expand Up @@ -312,7 +313,7 @@ To learn more about a subcommand, run `./x.py <subcommand> -h`",
"clippy" => {
opts.optflag("", "fix", "automatically apply lint suggestions");
}
"doc" => {
"doc" | "d" => {
opts.optflag("", "open", "open the docs in a browser");
}
"clean" => {
Expand Down Expand Up @@ -487,7 +488,7 @@ Arguments:
./x.py test --stage 1",
);
}
"doc" => {
"doc" | "d" => {
subcommand_help.push_str(
"\n
Arguments:
Expand Down Expand Up @@ -573,7 +574,7 @@ Arguments:
},
},
"bench" => Subcommand::Bench { paths, test_args: matches.opt_strs("test-args") },
"doc" => Subcommand::Doc { paths, open: matches.opt_present("open") },
"doc" | "d" => Subcommand::Doc { paths, open: matches.opt_present("open") },
"clean" => {
if !paths.is_empty() {
println!("\nclean does not take a path argument\n");
Expand Down

0 comments on commit a247257

Please sign in to comment.