Skip to content

Conversation

@benodiwal
Copy link

What does this PR try to resolve?

Fixes #15648

When running cargo --help, users are told to "See all commands with --list". A natural interpretation is that cargo --help --list should show the full list of commands. However, clap's automatic --help handling exits early, so --list was being ignored.

This PR makes --help --list (or -h --list, or --list --help) behave as --list, showing the full list of installed commands.

How to test and review this PR?

Before this change:

 cargo --help --list
 # Shows only the help output, --list is ignored

After this change:

cargo --help --list
Installed Commands:
    add                  Add dependencies to a Cargo.toml manifest file
    bench                Execute all benchmarks of a local package
    build                Compile a local package and all of its dependencies
    ...

@rustbot rustbot added A-cli Area: Command-line interface, option parsing, etc. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 9, 2025
@rustbot
Copy link
Collaborator

rustbot commented Dec 9, 2025

r? @weihanglo

rustbot has assigned @weihanglo.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@epage
Copy link
Contributor

epage commented Dec 9, 2025

Note that the issue hasn't been accepted by the Cargo team.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-cli Area: Command-line interface, option parsing, etc. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Suggestion: Interpret --help --list as equivalent to --list

4 participants