Skip to content

Commit

Permalink
Auto merge of #12823 - calavera:fix_remove_help_typos, r=epage
Browse files Browse the repository at this point in the history
Clarify flag behavior in `cargo remove --help`

### What does this PR try to resolve?

I noticed what I believe are typos in `cargo rm --help`:

```
Section:
      --dev              Remove as development dependency
      --build            Remove as build dependency
      --target <TARGET>  Remove as dependency from the given target platform
```

This change updates that section with a more appropriate description of those flags.

### How should we test and review this PR?

I've updated the relevant test for that help output.

### Additional information

Sorry for not opening an issue about this. I believe it's easy enough to approve it if my assumption is correct.
  • Loading branch information
bors committed Oct 16, 2023
2 parents 87f4b1b + a8413d3 commit d360280
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/bin/cargo/commands/remove.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,19 @@ pub fn cli() -> clap::Command {
.conflicts_with("build")
.action(clap::ArgAction::SetTrue)
.group("section")
.help("Remove as development dependency"),
.help("Remove from dev-dependencies"),
clap::Arg::new("build")
.long("build")
.conflicts_with("dev")
.action(clap::ArgAction::SetTrue)
.group("section")
.help("Remove as build dependency"),
.help("Remove from build-dependencies"),
clap::Arg::new("target")
.long("target")
.num_args(1)
.value_name("TARGET")
.value_parser(clap::builder::NonEmptyStringValueParser::new())
.help("Remove as dependency from the given target platform"),
.help("Remove from target-dependencies"),
])
.arg_package("Package to remove from")
.arg_manifest_path()
Expand Down
6 changes: 3 additions & 3 deletions tests/testsuite/cargo_remove/help/stdout.log
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ Options:
-h, --help Print help

Section:
--dev Remove as development dependency
--build Remove as build dependency
--target <TARGET> Remove as dependency from the given target platform
--dev Remove development dependencies
--build Remove build dependencies
--target <TARGET> Remove dependencies from the given target platform

Package Selection:
-p, --package [<SPEC>] Package to remove from
Expand Down

0 comments on commit d360280

Please sign in to comment.