feat: Exclude undocumented commands
This commit is contained in:
parent
00eeeb78de
commit
ae28fe92d2
7 changed files with 14 additions and 220 deletions
|
|
@ -54,15 +54,17 @@ fn flatten_subcommands(command: &Command) -> Vec<Subcommand> {
|
|||
let description = command
|
||||
.get_long_about()
|
||||
.or_else(|| command.get_about())
|
||||
.map_or_else(|| "_(no description)_".to_owned(), ToString::to_string);
|
||||
.map(ToString::to_string);
|
||||
|
||||
subcommands.push(
|
||||
Subcommand {
|
||||
name,
|
||||
description,
|
||||
depth,
|
||||
}
|
||||
);
|
||||
if let Some(description) = description {
|
||||
subcommands.push(
|
||||
Subcommand {
|
||||
name,
|
||||
description,
|
||||
depth,
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
for command in command.get_subcommands() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue