Skip to content

Commit

Permalink
fix(help): Use standard alternate syntax for subcommands
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Feb 14, 2022
1 parent 9a83ada commit a140a1d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions examples/pacman.md
Expand Up @@ -58,7 +58,7 @@ pacman[EXE]-sync
Synchronize packages.

USAGE:
pacman[EXE] {sync, --sync, -S} [OPTIONS] [--] [package]...
pacman[EXE] {sync|--sync|-S} [OPTIONS] [--] [package]...

ARGS:
<package>... packages
Expand All @@ -77,7 +77,7 @@ $ pacman -S -s foo -i bar
error: The argument '--search <search>...' cannot be used with '--info'

USAGE:
pacman[EXE] {sync, --sync, -S} --search <search>... <package>...
pacman[EXE] {sync|--sync|-S} --search <search>... <package>...

For more information try --help

Expand Down
4 changes: 2 additions & 2 deletions src/build/app.rs
Expand Up @@ -4003,11 +4003,11 @@ impl<'help> App<'help> {
let mut sc_names = sc.name.clone();
let mut flag_subcmd = false;
if let Some(l) = sc.long_flag {
write!(sc_names, ", --{}", l).unwrap();
write!(sc_names, "|--{}", l).unwrap();
flag_subcmd = true;
}
if let Some(s) = sc.short_flag {
write!(sc_names, ", -{}", s).unwrap();
write!(sc_names, "|-{}", s).unwrap();
flag_subcmd = true;
}

Expand Down

0 comments on commit a140a1d

Please sign in to comment.