Skip to content

Commit d0a4ac3

Browse files
Managoracuteenvy
andauthored
cargo*: add option placeholders and fix some syntax (#17270)
Co-authored-by: Lena <[email protected]>
1 parent 701b0ab commit d0a4ac3

File tree

10 files changed

+17
-17
lines changed

10 files changed

+17
-17
lines changed

pages/common/cargo-add.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
- Add a dependency and enable one or more specific features:
1515

16-
`cargo add {{dependency}} --features {{feature_1}},{{feature_2}}`
16+
`cargo add {{dependency}} {{[-F|--features]}} {{feature_1}},{{feature_2}}`
1717

1818
- Add an optional dependency, which then gets exposed as a feature of the crate:
1919

pages/common/cargo-clean.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
- Remove release artifacts (the `target/release` directory):
1515

16-
`cargo clean --release`
16+
`cargo clean {{[-r|--release]}}`
1717

1818
- Remove artifacts in the directory of the given profile (in this case, `target/debug`):
1919

pages/common/cargo-clippy.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@
2121

2222
- Run checks for a lint group (see <https://rust-lang.github.io/rust-clippy/stable/index.html#?groups=cargo,complexity,correctness,deprecated,nursery,pedantic,perf,restriction,style,suspicious>):
2323

24-
`cargo clippy -- --warn clippy::{{lint_group}}`
24+
`cargo clippy -- {{[-W|--warn]}} clippy::{{lint_group}}`
2525

2626
- Treat warnings as errors:
2727

28-
`cargo clippy -- --deny warnings`
28+
`cargo clippy -- {{[-D|--deny]}} warnings`
2929

3030
- Run checks and ignore warnings:
3131

32-
`cargo clippy -- --allow warnings`
32+
`cargo clippy -- {{[-A|--allow]}} warnings`
3333

3434
- Apply Clippy suggestions automatically:
3535

pages/common/cargo-owner.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
66
- Invite the given user or team as an owner:
77

8-
`cargo owner --add {{username|github:org_name:team_name}} {{crate}}`
8+
`cargo owner {{[-a|--add]}} {{username|github:org_name:team_name}} {{crate}}`
99

1010
- Remove the given user or team as an owner:
1111

12-
`cargo owner --remove {{username|github:org_name:team_name}} {{crate}}`
12+
`cargo owner {{[-r|--remove]}} {{username|github:org_name:team_name}} {{crate}}`
1313

1414
- List owners of a crate:
1515

16-
`cargo owner --list {{crate}}`
16+
`cargo owner {{[-l|--list]}} {{crate}}`
1717

1818
- Use the specified registry (registry names can be defined in the configuration - the default is <https://crates.io>):
1919

pages/common/cargo-package.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@
1010

1111
- Display what files would be included in the tarball without actually creating it:
1212

13-
`cargo package --list`
13+
`cargo package {{[-l|--list]}}`

pages/common/cargo-publish.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
- Perform checks, create a `.crate` file but don't upload it (equivalent of `cargo package`):
1212

13-
`cargo publish --dry-run`
13+
`cargo publish {{[-n|--dry-run]}}`
1414

1515
- Use the specified registry (registry names can be defined in the configuration - the default is <https://crates.io>):
1616

pages/common/cargo-report.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
> Display various kinds of reports.
44
> More information: <https://doc.rust-lang.org/cargo/commands/cargo-report.html>.
55
6-
- Display a report:
6+
- Display a report of crates which will eventually stop compiling:
77

8-
`cargo report {{future-incompatibilities|...}}`
8+
`cargo report future-incompatibilities`
99

1010
- Display a report with the specified Cargo-generated ID:
1111

12-
`cargo report {{future-incompatibilities|...}} --id {{id}}`
12+
`cargo report future-incompatibilities --id {{id}}`
1313

1414
- Display a report for the specified package:
1515

16-
`cargo report {{future-incompatibilities|...}} --package {{package}}`
16+
`cargo report future-incompatibilities {{[-p|--package]}} {{package}}`

pages/common/cargo-tree.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@
2222

2323
- Only show normal/build/development dependencies:
2424

25-
`cargo tree --edges {{normal|build|dev}}`
25+
`cargo tree {{[-e|--edges]}} {{normal|build|dev}}`

pages/common/cargo-update.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
- Display what would be updated, but don't actually write the lockfile:
1111

12-
`cargo update --dry-run`
12+
`cargo update {{[-n|--dry-run]}}`
1313

1414
- Update only the specified dependencies:
1515

pages/common/cargo-version.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99

1010
- Display additional build information:
1111

12-
`cargo version --verbose`
12+
`cargo version {{[-v|--verbose]}}`

0 commit comments

Comments
 (0)