Skip to content

Commit 88d4d94

Browse files
committed
Auto merge of #12570 - dtolnay-contrib:subcommandtemplate, r=weihanglo
Define {{command}} for use in src/doc/man/includes I am interested in using this in #12568. ```diff {{#option "`--keep-going`"}} Build as many crates in the dependency graph as possible, rather than aborting the build on the first one that fails to build. For example if the current package depends on dependencies `fails` and `works`, - one of which fails to build, `cargo check -j1` may or may not build the one that + one of which fails to build, `cargo {{command}} -j1` may or may not build the one that succeeds (depending on which one of the two builds Cargo picked to run first), - whereas `cargo check -j1 --keep-going` would definitely run both builds, even if + whereas `cargo {{command}} -j1 --keep-going` would definitely run both builds, even if the one run first fails. {{/option}} ```
2 parents 8d73765 + 134a00c commit 88d4d94

34 files changed

+54
-76
lines changed

src/doc/man/cargo-add.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# cargo-add(1)
2-
3-
{{*set actionverb="Add"}}
4-
{{*set nouns="adds"}}
2+
{{~*set command="add"}}
3+
{{~*set actionverb="Add"}}
4+
{{~*set nouns="adds"}}
55

66
## NAME
77

src/doc/man/cargo-bench.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# cargo-bench(1)
2-
{{*set actionverb="Benchmark"}}
3-
{{*set nouns="benchmarks"}}
4-
{{*set multitarget=true}}
2+
{{~*set command="bench"}}
3+
{{~*set actionverb="Benchmark"}}
4+
{{~*set nouns="benchmarks"}}
5+
{{~*set multitarget=true}}
56

67
## NAME
78

src/doc/man/cargo-build.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# cargo-build(1)
2-
{{*set actionverb="Build"}}
3-
{{*set multitarget=true}}
2+
{{~*set command="build"}}
3+
{{~*set actionverb="Build"}}
4+
{{~*set multitarget=true}}
45

56
## NAME
67

src/doc/man/cargo-check.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# cargo-check(1)
2-
{{*set actionverb="Check"}}
3-
{{*set multitarget=true}}
2+
{{~*set command="check"}}
3+
{{~*set actionverb="Check"}}
4+
{{~*set multitarget=true}}
45

56
## NAME
67

src/doc/man/cargo-clean.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# cargo-clean(1)
2-
{{*set actionverb="Clean"}}
3-
{{*set multitarget=true}}
2+
{{~*set command="clean"}}
3+
{{~*set actionverb="Clean"}}
4+
{{~*set multitarget=true}}
45

56
## NAME
67

src/doc/man/cargo-doc.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# cargo-doc(1)
2-
{{*set actionverb="Document"}}
3-
{{*set multitarget=true}}
2+
{{~*set command="doc"}}
3+
{{~*set actionverb="Document"}}
4+
{{~*set multitarget=true}}
45

56
## NAME
67

src/doc/man/cargo-fetch.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# cargo-fetch(1)
2-
{{*set actionverb="Fetch"}}
3-
{{*set target-default-to-all-arch=true}}
4-
{{*set multitarget=true}}
2+
{{~*set command="fetch"}}
3+
{{~*set actionverb="Fetch"}}
4+
{{~*set target-default-to-all-arch=true}}
5+
{{~*set multitarget=true}}
56

67
## NAME
78

src/doc/man/cargo-fix.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# cargo-fix(1)
2-
{{*set actionverb="Fix"}}
3-
{{*set multitarget=true}}
2+
{{~*set command="fix"}}
3+
{{~*set actionverb="Fix"}}
4+
{{~*set multitarget=true}}
45

56
## NAME
67

src/doc/man/cargo-install.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# cargo-install(1)
2-
{{*set actionverb="Install"}}
3-
{{*set temp-target-dir=true}}
2+
{{~*set command="install"}}
3+
{{~*set actionverb="Install"}}
4+
{{~*set temp-target-dir=true}}
45

56
## NAME
67

src/doc/man/cargo-package.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# cargo-package(1)
2-
{{*set actionverb="Package"}}
3-
{{*set noall=true}}
4-
{{*set multitarget=true}}
2+
{{~*set command="package"}}
3+
{{~*set actionverb="Package"}}
4+
{{~*set noall=true}}
5+
{{~*set multitarget=true}}
56

67
## NAME
78

src/doc/man/cargo-publish.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# cargo-publish(1)
2-
{{*set actionverb="Publish"}}
3-
{{*set multitarget=true}}
2+
{{~*set command="publish"}}
3+
{{~*set actionverb="Publish"}}
4+
{{~*set multitarget=true}}
45

56
## NAME
67

src/doc/man/cargo-remove.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# cargo-remove(1)
2-
{{*set actionverb="Remove"}}
3-
{{*set nouns="removes"}}
2+
{{~*set command="remove"}}
3+
{{~*set actionverb="Remove"}}
4+
{{~*set nouns="removes"}}
45

56
## NAME
67

src/doc/man/cargo-run.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# cargo-run(1)
2-
{{*set actionverb="Run"}}
2+
{{~*set command="run"}}
3+
{{~*set actionverb="Run"}}
34

45
## NAME
56

src/doc/man/cargo-rustc.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# cargo-rustc(1)
2-
{{*set actionverb="Build"}}
3-
{{*set multitarget=true}}
2+
{{~*set command="rustc"}}
3+
{{~*set actionverb="Build"}}
4+
{{~*set multitarget=true}}
45

56
## NAME
67

src/doc/man/cargo-rustdoc.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# cargo-rustdoc(1)
2-
{{*set actionverb="Document"}}
3-
{{*set multitarget=true}}
2+
{{~*set command="rustdoc"}}
3+
{{~*set actionverb="Document"}}
4+
{{~*set multitarget=true}}
45

56
## NAME
67

src/doc/man/cargo-test.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# cargo-test(1)
2-
{{*set actionverb="Test"}}
3-
{{*set nouns="tests"}}
4-
{{*set multitarget=true}}
2+
{{~*set command="test"}}
3+
{{~*set actionverb="Test"}}
4+
{{~*set nouns="tests"}}
5+
{{~*set multitarget=true}}
56

67
## NAME
78

src/doc/man/cargo-tree.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# cargo-tree(1)
2-
{{*set actionverb="Display"}}
3-
{{*set noall=true}}
2+
{{~*set command="tree"}}
3+
{{~*set actionverb="Display"}}
4+
{{~*set noall=true}}
45

56
## NAME
67

src/doc/src/commands/cargo-add.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
# cargo-add(1)
22

3-
4-
5-
63
## NAME
74

85
cargo-add --- Add dependencies to a Cargo.toml manifest file

src/doc/src/commands/cargo-bench.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
# cargo-bench(1)
22

3-
4-
5-
63
## NAME
74

85
cargo-bench --- Execute benchmarks of a package

src/doc/src/commands/cargo-build.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# cargo-build(1)
22

3-
4-
53
## NAME
64

75
cargo-build --- Compile the current package

src/doc/src/commands/cargo-check.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# cargo-check(1)
22

3-
4-
53
## NAME
64

75
cargo-check --- Check the current package

src/doc/src/commands/cargo-clean.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# cargo-clean(1)
22

3-
4-
53
## NAME
64

75
cargo-clean --- Remove generated artifacts

src/doc/src/commands/cargo-doc.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# cargo-doc(1)
22

3-
4-
53
## NAME
64

75
cargo-doc --- Build a package's documentation

src/doc/src/commands/cargo-fetch.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
# cargo-fetch(1)
22

3-
4-
5-
63
## NAME
74

85
cargo-fetch --- Fetch dependencies of a package from the network

src/doc/src/commands/cargo-fix.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# cargo-fix(1)
22

3-
4-
53
## NAME
64

75
cargo-fix --- Automatically fix lint warnings reported by rustc

src/doc/src/commands/cargo-install.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# cargo-install(1)
22

3-
4-
53
## NAME
64

75
cargo-install --- Build and install a Rust binary

src/doc/src/commands/cargo-package.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
# cargo-package(1)
22

3-
4-
5-
63
## NAME
74

85
cargo-package --- Assemble the local package into a distributable tarball

src/doc/src/commands/cargo-publish.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# cargo-publish(1)
22

3-
4-
53
## NAME
64

75
cargo-publish --- Upload a package to the registry

src/doc/src/commands/cargo-remove.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# cargo-remove(1)
22

3-
4-
53
## NAME
64

75
cargo-remove --- Remove dependencies from a Cargo.toml manifest file

src/doc/src/commands/cargo-run.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# cargo-run(1)
22

3-
43
## NAME
54

65
cargo-run --- Run the current package

src/doc/src/commands/cargo-rustc.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# cargo-rustc(1)
22

3-
4-
53
## NAME
64

75
cargo-rustc --- Compile the current package, and pass extra options to the compiler

src/doc/src/commands/cargo-rustdoc.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# cargo-rustdoc(1)
22

3-
4-
53
## NAME
64

75
cargo-rustdoc --- Build a package's documentation, using specified custom flags

src/doc/src/commands/cargo-test.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
# cargo-test(1)
22

3-
4-
5-
63
## NAME
74

85
cargo-test --- Execute unit and integration tests of a package

src/doc/src/commands/cargo-tree.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# cargo-tree(1)
22

3-
4-
53
## NAME
64

75
cargo-tree --- Display a tree visualization of a dependency graph

0 commit comments

Comments
 (0)