Skip to content

Commit 226933f

Browse files
committed
Use existing arg_dry_run function.
And drop the `-n` short flag until we decide to commit to using it generally.
1 parent 53adc7e commit 226933f

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

src/bin/cargo/commands/clean.rs

+2-8
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,7 @@ pub fn cli() -> Command {
1414
.arg_target_triple("Target triple to clean output for")
1515
.arg_target_dir()
1616
.arg_manifest_path()
17-
.arg(
18-
flag(
19-
"dry-run",
20-
"Display what would be deleted without deleting anything",
21-
)
22-
.short('n'),
23-
)
17+
.arg_dry_run("Display what would be deleted without deleting anything")
2418
.after_help("Run `cargo help clean` for more detailed information.\n")
2519
}
2620

@@ -38,7 +32,7 @@ pub fn exec(config: &mut Config, args: &ArgMatches) -> CliResult {
3832
requested_profile: args.get_profile_name(config, "dev", ProfileChecking::Custom)?,
3933
profile_specified: args.contains_id("profile") || args.flag("release"),
4034
doc: args.flag("doc"),
41-
dry_run: args.flag("dry-run"),
35+
dry_run: args.dry_run(),
4236
};
4337
ops::clean(&ws, &opts)?;
4438
Ok(())

tests/testsuite/cargo_clean/help/stdout.log

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Usage: cargo[EXE] clean [OPTIONS]
55
Options:
66
--doc Whether or not to clean just the documentation directory
77
-q, --quiet Do not print cargo log messages
8-
-n, --dry-run Display what would be deleted without deleting anything
8+
--dry-run Display what would be deleted without deleting anything
99
-v, --verbose... Use verbose output (-vv very verbose/build.rs output)
1010
--color <WHEN> Coloring: auto, always, never
1111
--config <KEY=VALUE> Override a configuration value

0 commit comments

Comments
 (0)