diff options
author | Ilya Dryomov <idryomov@gmail.com> | 2012-02-08 17:45:54 +0200 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2012-02-08 18:55:51 +0200 |
commit | 08b51bd731467ac8da182d69c827a8a5c7877079 (patch) | |
tree | 43bf4f0075db78ee1170fb9f96cefaf591b38ddf /help.c | |
parent | 6cd813b6fc18ba75edfcfad5857d27f0265c2c28 (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.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -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); |