Skip to content

Commit

Permalink
Auto merge of #12570 - dtolnay-contrib:subcommandtemplate, r=weihanglo
Browse files Browse the repository at this point in the history
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}}
```
  • Loading branch information
bors committed Aug 26, 2023
2 parents 8d73765 + 134a00c commit 88d4d94
Show file tree
Hide file tree
Showing 34 changed files with 54 additions and 76 deletions.
6 changes: 3 additions & 3 deletions src/doc/man/cargo-add.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# cargo-add(1)

{{*set actionverb="Add"}}
{{*set nouns="adds"}}
{{~*set command="add"}}
{{~*set actionverb="Add"}}
{{~*set nouns="adds"}}

## NAME

Expand Down
7 changes: 4 additions & 3 deletions src/doc/man/cargo-bench.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# cargo-bench(1)
{{*set actionverb="Benchmark"}}
{{*set nouns="benchmarks"}}
{{*set multitarget=true}}
{{~*set command="bench"}}
{{~*set actionverb="Benchmark"}}
{{~*set nouns="benchmarks"}}
{{~*set multitarget=true}}

## NAME

Expand Down
5 changes: 3 additions & 2 deletions src/doc/man/cargo-build.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# cargo-build(1)
{{*set actionverb="Build"}}
{{*set multitarget=true}}
{{~*set command="build"}}
{{~*set actionverb="Build"}}
{{~*set multitarget=true}}

## NAME

Expand Down
5 changes: 3 additions & 2 deletions src/doc/man/cargo-check.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# cargo-check(1)
{{*set actionverb="Check"}}
{{*set multitarget=true}}
{{~*set command="check"}}
{{~*set actionverb="Check"}}
{{~*set multitarget=true}}

## NAME

Expand Down
5 changes: 3 additions & 2 deletions src/doc/man/cargo-clean.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# cargo-clean(1)
{{*set actionverb="Clean"}}
{{*set multitarget=true}}
{{~*set command="clean"}}
{{~*set actionverb="Clean"}}
{{~*set multitarget=true}}

## NAME

Expand Down
5 changes: 3 additions & 2 deletions src/doc/man/cargo-doc.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# cargo-doc(1)
{{*set actionverb="Document"}}
{{*set multitarget=true}}
{{~*set command="doc"}}
{{~*set actionverb="Document"}}
{{~*set multitarget=true}}

## NAME

Expand Down
7 changes: 4 additions & 3 deletions src/doc/man/cargo-fetch.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# cargo-fetch(1)
{{*set actionverb="Fetch"}}
{{*set target-default-to-all-arch=true}}
{{*set multitarget=true}}
{{~*set command="fetch"}}
{{~*set actionverb="Fetch"}}
{{~*set target-default-to-all-arch=true}}
{{~*set multitarget=true}}

## NAME

Expand Down
5 changes: 3 additions & 2 deletions src/doc/man/cargo-fix.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# cargo-fix(1)
{{*set actionverb="Fix"}}
{{*set multitarget=true}}
{{~*set command="fix"}}
{{~*set actionverb="Fix"}}
{{~*set multitarget=true}}

## NAME

Expand Down
5 changes: 3 additions & 2 deletions src/doc/man/cargo-install.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# cargo-install(1)
{{*set actionverb="Install"}}
{{*set temp-target-dir=true}}
{{~*set command="install"}}
{{~*set actionverb="Install"}}
{{~*set temp-target-dir=true}}

## NAME

Expand Down
7 changes: 4 additions & 3 deletions src/doc/man/cargo-package.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# cargo-package(1)
{{*set actionverb="Package"}}
{{*set noall=true}}
{{*set multitarget=true}}
{{~*set command="package"}}
{{~*set actionverb="Package"}}
{{~*set noall=true}}
{{~*set multitarget=true}}

## NAME

Expand Down
5 changes: 3 additions & 2 deletions src/doc/man/cargo-publish.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# cargo-publish(1)
{{*set actionverb="Publish"}}
{{*set multitarget=true}}
{{~*set command="publish"}}
{{~*set actionverb="Publish"}}
{{~*set multitarget=true}}

## NAME

Expand Down
5 changes: 3 additions & 2 deletions src/doc/man/cargo-remove.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# cargo-remove(1)
{{*set actionverb="Remove"}}
{{*set nouns="removes"}}
{{~*set command="remove"}}
{{~*set actionverb="Remove"}}
{{~*set nouns="removes"}}

## NAME

Expand Down
3 changes: 2 additions & 1 deletion src/doc/man/cargo-run.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# cargo-run(1)
{{*set actionverb="Run"}}
{{~*set command="run"}}
{{~*set actionverb="Run"}}

## NAME

Expand Down
5 changes: 3 additions & 2 deletions src/doc/man/cargo-rustc.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# cargo-rustc(1)
{{*set actionverb="Build"}}
{{*set multitarget=true}}
{{~*set command="rustc"}}
{{~*set actionverb="Build"}}
{{~*set multitarget=true}}

## NAME

Expand Down
5 changes: 3 additions & 2 deletions src/doc/man/cargo-rustdoc.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# cargo-rustdoc(1)
{{*set actionverb="Document"}}
{{*set multitarget=true}}
{{~*set command="rustdoc"}}
{{~*set actionverb="Document"}}
{{~*set multitarget=true}}

## NAME

Expand Down
7 changes: 4 additions & 3 deletions src/doc/man/cargo-test.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# cargo-test(1)
{{*set actionverb="Test"}}
{{*set nouns="tests"}}
{{*set multitarget=true}}
{{~*set command="test"}}
{{~*set actionverb="Test"}}
{{~*set nouns="tests"}}
{{~*set multitarget=true}}

## NAME

Expand Down
5 changes: 3 additions & 2 deletions src/doc/man/cargo-tree.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# cargo-tree(1)
{{*set actionverb="Display"}}
{{*set noall=true}}
{{~*set command="tree"}}
{{~*set actionverb="Display"}}
{{~*set noall=true}}

## NAME

Expand Down
3 changes: 0 additions & 3 deletions src/doc/src/commands/cargo-add.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
# cargo-add(1)




## NAME

cargo-add --- Add dependencies to a Cargo.toml manifest file
Expand Down
3 changes: 0 additions & 3 deletions src/doc/src/commands/cargo-bench.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
# cargo-bench(1)




## NAME

cargo-bench --- Execute benchmarks of a package
Expand Down
2 changes: 0 additions & 2 deletions src/doc/src/commands/cargo-build.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# cargo-build(1)



## NAME

cargo-build --- Compile the current package
Expand Down
2 changes: 0 additions & 2 deletions src/doc/src/commands/cargo-check.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# cargo-check(1)



## NAME

cargo-check --- Check the current package
Expand Down
2 changes: 0 additions & 2 deletions src/doc/src/commands/cargo-clean.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# cargo-clean(1)



## NAME

cargo-clean --- Remove generated artifacts
Expand Down
2 changes: 0 additions & 2 deletions src/doc/src/commands/cargo-doc.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# cargo-doc(1)



## NAME

cargo-doc --- Build a package's documentation
Expand Down
3 changes: 0 additions & 3 deletions src/doc/src/commands/cargo-fetch.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
# cargo-fetch(1)




## NAME

cargo-fetch --- Fetch dependencies of a package from the network
Expand Down
2 changes: 0 additions & 2 deletions src/doc/src/commands/cargo-fix.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# cargo-fix(1)



## NAME

cargo-fix --- Automatically fix lint warnings reported by rustc
Expand Down
2 changes: 0 additions & 2 deletions src/doc/src/commands/cargo-install.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# cargo-install(1)



## NAME

cargo-install --- Build and install a Rust binary
Expand Down
3 changes: 0 additions & 3 deletions src/doc/src/commands/cargo-package.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
# cargo-package(1)




## NAME

cargo-package --- Assemble the local package into a distributable tarball
Expand Down
2 changes: 0 additions & 2 deletions src/doc/src/commands/cargo-publish.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# cargo-publish(1)



## NAME

cargo-publish --- Upload a package to the registry
Expand Down
2 changes: 0 additions & 2 deletions src/doc/src/commands/cargo-remove.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# cargo-remove(1)



## NAME

cargo-remove --- Remove dependencies from a Cargo.toml manifest file
Expand Down
1 change: 0 additions & 1 deletion src/doc/src/commands/cargo-run.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# cargo-run(1)


## NAME

cargo-run --- Run the current package
Expand Down
2 changes: 0 additions & 2 deletions src/doc/src/commands/cargo-rustc.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# cargo-rustc(1)



## NAME

cargo-rustc --- Compile the current package, and pass extra options to the compiler
Expand Down
2 changes: 0 additions & 2 deletions src/doc/src/commands/cargo-rustdoc.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# cargo-rustdoc(1)



## NAME

cargo-rustdoc --- Build a package's documentation, using specified custom flags
Expand Down
3 changes: 0 additions & 3 deletions src/doc/src/commands/cargo-test.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
# cargo-test(1)




## NAME

cargo-test --- Execute unit and integration tests of a package
Expand Down
2 changes: 0 additions & 2 deletions src/doc/src/commands/cargo-tree.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# cargo-tree(1)



## NAME

cargo-tree --- Display a tree visualization of a dependency graph
Expand Down

0 comments on commit 88d4d94

Please sign in to comment.