From e9f1287b639ddb5a05107f9c1662b69af195e521 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Mon, 19 Sep 2022 09:07:37 -0500 Subject: [PATCH] fix(help): Separate command flags like options Fixes #4232 --- examples/pacman.md | 6 +++--- src/output/help.rs | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/pacman.md b/examples/pacman.md index f75ac172d7f..73ec86fafa1 100644 --- a/examples/pacman.md +++ b/examples/pacman.md @@ -40,9 +40,9 @@ package manager utility Usage: pacman[EXE] 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 diff --git a/src/output/help.rs b/src/output/help.rs index fd7292ceb9a..f20ccc9e21f 100644 --- a/src/output/help.rs +++ b/src/output/help.rs @@ -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());