summaryrefslogtreecommitdiff
path: root/help.c
diff options
context:
space:
mode:
authorOmar Sandoval <osandov@fb.com>2015-06-24 09:09:17 -0700
committerDavid Sterba <dsterba@suse.cz>2015-06-26 16:33:39 +0200
commitf802f572b1cb1d33bab9747e87e6506b284546cf (patch)
treee8763c099809f0eb6129d95be98d8fe9ee033fe1 /help.c
parent12aba72aed310d6d3215684c44849233df7d79d2 (diff)
btrfs-progs: alias btrfs device delete to btrfs device remove
There's an awkward asymmetry between btrfs device add and btrfs device delete. Resolve this by aliasing delete to remove. Signed-off-by: Omar Sandoval <osandov@fb.com> Signed-off-by: David Sterba <dsterba@suse.cz>
Diffstat (limited to 'help.c')
-rw-r--r--help.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/help.c b/help.c
index e57d9f2..eacce84 100644
--- a/help.c
+++ b/help.c
@@ -79,11 +79,13 @@ static int do_usage_one_command(const char * const *usagestr,
static int usage_command_internal(const char * const *usagestr,
const char *token, int full, int lst,
- FILE *outf)
+ int alias, FILE *outf)
{
- unsigned int flags = USAGE_SHORT;
+ unsigned int flags = 0;
int ret;
+ if (!alias)
+ flags |= USAGE_SHORT;
if (full)
flags |= USAGE_LONG | USAGE_OPTIONS;
if (lst)
@@ -108,7 +110,7 @@ static void usage_command_usagestr(const char * const *usagestr,
FILE *outf = err ? stderr : stdout;
int ret;
- ret = usage_command_internal(usagestr, token, full, 0, outf);
+ ret = usage_command_internal(usagestr, token, full, 0, 0, outf);
if (!ret)
fputc('\n', outf);
}
@@ -144,7 +146,7 @@ static void usage_command_group_internal(const struct cmd_group *grp, int full,
}
usage_command_internal(cmd->usagestr, cmd->token, full,
- 1, outf);
+ 1, cmd->flags & CMD_ALIAS, outf);
continue;
}