Skip to content

cargo*: add option placeholders and fix some syntax #17270

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pages/common/cargo-add.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

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

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

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

Expand Down
2 changes: 1 addition & 1 deletion pages/common/cargo-clean.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

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

`cargo clean --release`
`cargo clean {{[-r|--release]}}`

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

Expand Down
6 changes: 3 additions & 3 deletions pages/common/cargo-clippy.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@

- 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>):

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

- Treat warnings as errors:

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

- Run checks and ignore warnings:

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

- Apply Clippy suggestions automatically:

Expand Down
6 changes: 3 additions & 3 deletions pages/common/cargo-owner.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@

- Invite the given user or team as an owner:

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

- Remove the given user or team as an owner:

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

- List owners of a crate:

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

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

Expand Down
2 changes: 1 addition & 1 deletion pages/common/cargo-package.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@

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

`cargo package --list`
`cargo package {{[-l|--list]}}`
2 changes: 1 addition & 1 deletion pages/common/cargo-publish.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

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

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

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

Expand Down
8 changes: 4 additions & 4 deletions pages/common/cargo-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
> Display various kinds of reports.
> More information: <https://doc.rust-lang.org/cargo/commands/cargo-report.html>.

- Display a report:
- Display a report of crates which will eventually stop compiling:

`cargo report {{future-incompatibilities|...}}`
`cargo report future-incompatibilities`

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

`cargo report {{future-incompatibilities|...}} --id {{id}}`
`cargo report future-incompatibilities --id {{id}}`

- Display a report for the specified package:

`cargo report {{future-incompatibilities|...}} --package {{package}}`
`cargo report future-incompatibilities {{[-p|--package]}} {{package}}`
2 changes: 1 addition & 1 deletion pages/common/cargo-tree.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@

- Only show normal/build/development dependencies:

`cargo tree --edges {{normal|build|dev}}`
`cargo tree {{[-e|--edges]}} {{normal|build|dev}}`
2 changes: 1 addition & 1 deletion pages/common/cargo-update.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

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

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

- Update only the specified dependencies:

Expand Down
2 changes: 1 addition & 1 deletion pages/common/cargo-version.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@

- Display additional build information:

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