From d0a4ac3bc41d621ddece23518617792a764bf772 Mon Sep 17 00:00:00 2001 From: Managor <42655600+Managor@users.noreply.github.com> Date: Sun, 20 Jul 2025 18:41:22 +0300 Subject: [PATCH] cargo*: add option placeholders and fix some syntax (#17270) Co-authored-by: Lena <126529524+acuteenvy@users.noreply.github.com> --- pages/common/cargo-add.md | 2 +- pages/common/cargo-clean.md | 2 +- pages/common/cargo-clippy.md | 6 +++--- pages/common/cargo-owner.md | 6 +++--- pages/common/cargo-package.md | 2 +- pages/common/cargo-publish.md | 2 +- pages/common/cargo-report.md | 8 ++++---- pages/common/cargo-tree.md | 2 +- pages/common/cargo-update.md | 2 +- pages/common/cargo-version.md | 2 +- 10 files changed, 17 insertions(+), 17 deletions(-) diff --git a/pages/common/cargo-add.md b/pages/common/cargo-add.md index 275f36be13..0bce2b8188 100644 --- a/pages/common/cargo-add.md +++ b/pages/common/cargo-add.md @@ -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: diff --git a/pages/common/cargo-clean.md b/pages/common/cargo-clean.md index 1500c39f16..6b8af25fe4 100644 --- a/pages/common/cargo-clean.md +++ b/pages/common/cargo-clean.md @@ -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`): diff --git a/pages/common/cargo-clippy.md b/pages/common/cargo-clippy.md index aa8846f869..13948b8997 100644 --- a/pages/common/cargo-clippy.md +++ b/pages/common/cargo-clippy.md @@ -21,15 +21,15 @@ - Run checks for a lint group (see ): -`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: diff --git a/pages/common/cargo-owner.md b/pages/common/cargo-owner.md index 3ac6df292d..8186928161 100644 --- a/pages/common/cargo-owner.md +++ b/pages/common/cargo-owner.md @@ -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 ): diff --git a/pages/common/cargo-package.md b/pages/common/cargo-package.md index a0f6ccf40f..8ca02a9e82 100644 --- a/pages/common/cargo-package.md +++ b/pages/common/cargo-package.md @@ -10,4 +10,4 @@ - Display what files would be included in the tarball without actually creating it: -`cargo package --list` +`cargo package {{[-l|--list]}}` diff --git a/pages/common/cargo-publish.md b/pages/common/cargo-publish.md index 665a5be6b3..c0b61979b9 100644 --- a/pages/common/cargo-publish.md +++ b/pages/common/cargo-publish.md @@ -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 ): diff --git a/pages/common/cargo-report.md b/pages/common/cargo-report.md index ebe24cfb24..30c33c0eef 100644 --- a/pages/common/cargo-report.md +++ b/pages/common/cargo-report.md @@ -3,14 +3,14 @@ > Display various kinds of reports. > More information: . -- 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}}` diff --git a/pages/common/cargo-tree.md b/pages/common/cargo-tree.md index b2e69757cb..a240512ceb 100644 --- a/pages/common/cargo-tree.md +++ b/pages/common/cargo-tree.md @@ -22,4 +22,4 @@ - Only show normal/build/development dependencies: -`cargo tree --edges {{normal|build|dev}}` +`cargo tree {{[-e|--edges]}} {{normal|build|dev}}` diff --git a/pages/common/cargo-update.md b/pages/common/cargo-update.md index bac92afcae..11ec2ab48b 100644 --- a/pages/common/cargo-update.md +++ b/pages/common/cargo-update.md @@ -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: diff --git a/pages/common/cargo-version.md b/pages/common/cargo-version.md index 538b78887a..fa0ac70494 100644 --- a/pages/common/cargo-version.md +++ b/pages/common/cargo-version.md @@ -9,4 +9,4 @@ - Display additional build information: -`cargo version --verbose` +`cargo version {{[-v|--verbose]}}`