From 08b51bd731467ac8da182d69c827a8a5c7877079 Mon Sep 17 00:00:00 2001 From: Ilya Dryomov Date: Wed, 8 Feb 2012 17:45:54 +0200 Subject: Btrfs-progs: allow multi-line command group synopsis Signed-off-by: Ilya Dryomov --- help.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'help.c') diff --git a/help.c b/help.c index 932bdf26..6d042931 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); -- cgit v1.2.3