Skip to content

Commit 528ab12

Browse files
committed
Auto merge of #10300 - ehuss:list-help, r=alexcrichton
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.
2 parents c2950c8 + b655a89 commit 528ab12

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/bin/cargo/main.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,14 @@ fn list_commands(config: &Config) -> BTreeMap<String, CommandInfo> {
144144
}
145145
}
146146

147+
// `help` is special, so it needs to be inserted separately.
148+
commands.insert(
149+
"help".to_string(),
150+
CommandInfo::BuiltIn {
151+
about: Some("Displays help for a cargo subcommand".to_string()),
152+
},
153+
);
154+
147155
commands
148156
}
149157

0 commit comments

Comments
 (0)