1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-23 02:05:07 +03:00

After a diagnostic, suggest --help, rather than printing all --help output.

Print just one line:
Use `COMMAND --help' for more information.
after "real" diagnostic(s), rather than all of the usage lines.
Otherwise, the 30-40+ lines of --help output could obscure the real diagnostic.


Author: Jim Meyering <jim@meyering.net>
This commit is contained in:
Jim Meyering 2007-09-21 18:06:33 +00:00
parent eba4417947
commit 44976cef6c
2 changed files with 7 additions and 1 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.29 -
==================================
After a diagnostic, suggest --help, rather than printing all --help output.
Add %PVS extents option to lvresize, lvextend, and lvcreate.
Moved the obsolete test subdirectory to old-tests.
Remove no-longer-correct restrictions on PV arg count with stripes/mirrors.

View File

@ -466,6 +466,11 @@ static struct command *_find_command(const char *name)
return _cmdline.commands + i;
}
static void _short_usage(const char *name)
{
log_error("Run `%s --help' for more information.\n", name);
}
static void _usage(const char *name)
{
struct command *com = _find_command(name);
@ -921,7 +926,7 @@ int lvm_run_command(struct cmd_context *cmd, int argc, char **argv)
dm_pool_empty(cmd->mem);
if (ret == EINVALID_CMD_LINE && !_cmdline.interactive)
_usage(cmd->command->name);
_short_usage(cmd->command->name);
log_debug("Completed: %s", cmd->cmd_line);