summaryrefslogtreecommitdiff
path: root/help.c
diff options
context:
space:
mode:
authorIlya Dryomov <idryomov@gmail.com>2012-02-08 17:45:54 +0200
committerIlya Dryomov <idryomov@gmail.com>2012-02-08 18:55:51 +0200
commit08b51bd731467ac8da182d69c827a8a5c7877079 (patch)
tree43bf4f0075db78ee1170fb9f96cefaf591b38ddf /help.c
parent6cd813b6fc18ba75edfcfad5857d27f0265c2c28 (diff)
Btrfs-progs: allow multi-line command group synopsis
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'help.c')
-rw-r--r--help.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/help.c b/help.c
index 932bdf2..6d04293 100644
--- a/help.c
+++ b/help.c
@@ -162,9 +162,16 @@ static void usage_command_group_internal(const struct cmd_group *grp, int full,
void usage_command_group(const struct cmd_group *grp, int full, int err)
{
+ const char * const *usagestr = grp->usagestr;
FILE *outf = err ? stderr : stdout;
- fprintf(outf, "usage: %s\n\n", grp->usagestr);
+ if (usagestr && *usagestr) {
+ fprintf(outf, "usage: %s\n", *usagestr++);
+ while (*usagestr)
+ fprintf(outf, " or: %s\n", *usagestr++);
+ }
+
+ fputc('\n', outf);
usage_command_group_internal(grp, full, outf);
fputc('\n', outf);