mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-18 10:04:20 +03:00
Fix incorrect return value in help function.
This commit is contained in:
parent
3ad47d16ab
commit
ed96a9feb4
@ -1,5 +1,6 @@
|
||||
Version 2.02.44 -
|
||||
====================================
|
||||
Fix incorrect return value in help function.
|
||||
Fix vgrename using UUID in case there are VGs with the same name.
|
||||
Fix segfault when invalid field given in reporting commands.
|
||||
Refactor init_lvm() for lvmcmdline and clvmd.
|
||||
|
@ -568,14 +568,17 @@ static void _short_usage(const char *name)
|
||||
log_error("Run `%s --help' for more information.", name);
|
||||
}
|
||||
|
||||
static void _usage(const char *name)
|
||||
static int _usage(const char *name)
|
||||
{
|
||||
struct command *com = _find_command(name);
|
||||
|
||||
if (!com)
|
||||
return;
|
||||
if (!com) {
|
||||
log_print("%s: no such command.", name);
|
||||
return 0;
|
||||
}
|
||||
|
||||
log_print("%s: %s\n\n%s", com->name, com->desc, com->usage);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -852,15 +855,18 @@ static void _display_help(void)
|
||||
|
||||
int help(struct cmd_context *cmd __attribute((unused)), int argc, char **argv)
|
||||
{
|
||||
int ret = ECMD_PROCESSED;
|
||||
|
||||
if (!argc)
|
||||
_display_help();
|
||||
else {
|
||||
int i;
|
||||
for (i = 0; i < argc; i++)
|
||||
_usage(argv[i]);
|
||||
if (!_usage(argv[i]))
|
||||
ret = EINVALID_CMD_LINE;
|
||||
}
|
||||
|
||||
return 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int _override_settings(struct cmd_context *cmd)
|
||||
|
Loading…
x
Reference in New Issue
Block a user