Skip to content

Commit

Permalink
fix(help): Separate command flags like options
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Sep 19, 2022
1 parent ad05d16 commit e9f1287
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions examples/pacman.md
Expand Up @@ -40,9 +40,9 @@ package manager utility
Usage: pacman[EXE] <COMMAND>

Commands:
query -Q --query Query the package database.
sync -S --sync Synchronize packages.
help Print this message or the help of the given subcommand(s)
query, -Q, --query Query the package database.
sync, -S, --sync Synchronize packages.
help Print this message or the help of the given subcommand(s)

Options:
-h, --help Print help information
Expand Down
4 changes: 2 additions & 2 deletions src/output/help.rs
Expand Up @@ -818,11 +818,11 @@ impl<'cmd, 'writer> Help<'cmd, 'writer> {
let mut styled = StyledStr::new();
styled.literal(subcommand.get_name());
if let Some(short) = subcommand.get_short_flag() {
styled.none(" ");
styled.none(", ");
styled.literal(format!("-{}", short));
}
if let Some(long) = subcommand.get_long_flag() {
styled.none(" ");
styled.none(", ");
styled.literal(format!("--{}", long));
}
longest = longest.max(styled.display_width());
Expand Down

0 comments on commit e9f1287

Please sign in to comment.