Skip to content

Commit

Permalink
Auto merge of #11785 - BinderDavid:fix-help-string-of-cargo-tree, r=w…
Browse files Browse the repository at this point in the history
…eihanglo

Fix help string for  "--charset" option of "cargo tree"

The help text for the `cargo tree` subcommand currently is:

```console
> cargo --version
cargo 1.67.1 (8ecd4f2 2023-01-10)
> cargo tree --help
Display a tree visualization of a dependency graph

Usage: cargo tree [OPTIONS]

Options:
  -q, --quiet                 Do not print cargo log messages
      --manifest-path <PATH>  Path to Cargo.toml
  -p, --package [<SPEC>]      Package to be used as the root of the tree
  -v, --verbose...            Use verbose output (-vv very verbose/build.rs output)
      --workspace             Display the tree for all packages in the workspace
      --exclude <SPEC>        Exclude specific workspace members
      --color <WHEN>          Coloring: auto, always, never
      --frozen                Require Cargo.lock and cache are up to date
  -F, --features <FEATURES>   Space or comma separated list of features to activate
      --locked                Require Cargo.lock is up to date
      --all-features          Activate all available features
      --offline               Run without accessing the network
      --config <KEY=VALUE>    Override a configuration value
      --no-default-features   Do not activate the `default` feature
      --target <TRIPLE>       Filter dependencies matching the given target-triple (default host platform). Pass `all` to include all targets.
  -Z <FLAG>                   Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details
  -e, --edges <KINDS>         The kinds of dependencies to display (features, normal, build, dev, all, no-normal, no-build, no-dev, no-proc-macro)
  -i, --invert [<SPEC>]       Invert the tree direction and focus on the given package
      --prune <SPEC>          Prune the given package from the display of the dependency tree
      --depth <DEPTH>         Maximum display depth of the dependency tree
      --prefix <PREFIX>       Change the prefix (indentation) of how each entry is displayed [default: indent] [possible values: depth, indent, none]
      --no-dedupe             Do not de-duplicate (repeats all shared dependencies)
  -d, --duplicates            Show only dependencies which come in multiple versions (implies -i)
      --charset <CHARSET>     Character set to use in output: utf8, ascii [default: utf8] [possible values: utf8, ascii]
  -f, --format <FORMAT>       Format string used for printing dependencies [default: {p}]
  -h, --help                  Print help information
```

Note that for the `--charset` option, the information about available encodings is duplicated. This PR removes the duplication.
  • Loading branch information
bors committed Mar 1, 2023
2 parents 9880b40 + 80836cf commit e472ccc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/bin/cargo/commands/tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ pub fn cli() -> Command {
.alias("duplicate"),
)
.arg(
opt("charset", "Character set to use in output: utf8, ascii")
opt("charset", "Character set to use in output")
.value_name("CHARSET")
.value_parser(["utf8", "ascii"])
.default_value("utf8"),
Expand Down

0 comments on commit e472ccc

Please sign in to comment.