diff --git a/src/cargo/util/command_prelude.rs b/src/cargo/util/command_prelude.rs index f30833b7aa7..c8dc4df87c1 100644 --- a/src/cargo/util/command_prelude.rs +++ b/src/cargo/util/command_prelude.rs @@ -302,7 +302,7 @@ pub trait CommandExt: Sized { } fn arg_dry_run(self, dry_run: &'static str) -> Self { - self._arg(flag("dry-run", dry_run)) + self._arg(flag("dry-run", dry_run).short('n')) } fn arg_ignore_rust_version(self) -> Self { diff --git a/tests/testsuite/cargo_add/help/stdout.log b/tests/testsuite/cargo_add/help/stdout.log index 0daba1a9497..cf2a913132d 100644 --- a/tests/testsuite/cargo_add/help/stdout.log +++ b/tests/testsuite/cargo_add/help/stdout.log @@ -42,7 +42,7 @@ Options: --ignore-rust-version Ignore `rust-version` specification in packages (unstable) - --dry-run + -n, --dry-run Don't actually write the manifest -q, --quiet diff --git a/tests/testsuite/cargo_publish/help/stdout.log b/tests/testsuite/cargo_publish/help/stdout.log index db19a168d9b..df2594fb462 100644 --- a/tests/testsuite/cargo_publish/help/stdout.log +++ b/tests/testsuite/cargo_publish/help/stdout.log @@ -3,7 +3,7 @@ Upload a package to the registry Usage: cargo[EXE] publish [OPTIONS] Options: - --dry-run Perform all checks without uploading + -n, --dry-run Perform all checks without uploading --index Registry index URL to upload the package to --registry Registry to upload the package to --token Token to use when uploading diff --git a/tests/testsuite/cargo_remove/help/stdout.log b/tests/testsuite/cargo_remove/help/stdout.log index b8d16f0c254..8937fb9f391 100644 --- a/tests/testsuite/cargo_remove/help/stdout.log +++ b/tests/testsuite/cargo_remove/help/stdout.log @@ -6,7 +6,7 @@ Arguments: ... Dependencies to be removed Options: - --dry-run Don't actually write the manifest + -n, --dry-run Don't actually write the manifest -q, --quiet Do not print cargo log messages -v, --verbose... Use verbose output (-vv very verbose/build.rs output) --color Coloring: auto, always, never diff --git a/tests/testsuite/cargo_update/help/stdout.log b/tests/testsuite/cargo_update/help/stdout.log index 111ee72d4fc..92caeb65601 100644 --- a/tests/testsuite/cargo_update/help/stdout.log +++ b/tests/testsuite/cargo_update/help/stdout.log @@ -3,7 +3,7 @@ Update dependencies as recorded in the local lock file Usage: cargo[EXE] update [OPTIONS] [SPEC]... Options: - --dry-run Don't actually write the lockfile + -n, --dry-run Don't actually write the lockfile --recursive Force updating all dependencies of [SPEC]... as well --precise Update [SPEC] to exactly PRECISE -q, --quiet Do not print cargo log messages