Skip to content

Commit

Permalink
Auto merge of #10300 - ehuss:list-help, r=alexcrichton
Browse files Browse the repository at this point in the history
Include `help` in `--list`

This adds the `help` subcommand to the `--list` output. It previously was not included because `help` is handled differently from built-in subcommands.
  • Loading branch information
bors committed Jan 18, 2022
2 parents c2950c8 + b655a89 commit 528ab12
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/bin/cargo/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,14 @@ fn list_commands(config: &Config) -> BTreeMap<String, CommandInfo> {
}
}

// `help` is special, so it needs to be inserted separately.
commands.insert(
"help".to_string(),
CommandInfo::BuiltIn {
about: Some("Displays help for a cargo subcommand".to_string()),
},
);

commands
}

Expand Down

0 comments on commit 528ab12

Please sign in to comment.