1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-03 05:18:29 +03:00

vgimport/vgexport: return invalid cmd

When option parsing fails, return invalid cmd instead of fail.
This commit is contained in:
Zdenek Kabelac 2014-03-30 22:38:51 +02:00
parent 5aa2e5ec8c
commit cf29de5de0
3 changed files with 5 additions and 4 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.106 - Version 2.02.106 -
==================================== ====================================
Return proper invalid cmd when vgimport/exports find error in parameters.
Obtain list of known VGs for pvchange --all when using lvmetad. Obtain list of known VGs for pvchange --all when using lvmetad.
Add man page for lvm dumpconfig. Add man page for lvm dumpconfig.
Drop unused cmd pointer for internal function for_each_sub_lv(). Drop unused cmd pointer for internal function for_each_sub_lv().

View File

@ -56,12 +56,12 @@ int vgexport(struct cmd_context *cmd, int argc, char **argv)
{ {
if (!argc && !arg_count(cmd, all_ARG)) { if (!argc && !arg_count(cmd, all_ARG)) {
log_error("Please supply volume groups or use -a for all."); log_error("Please supply volume groups or use -a for all.");
return ECMD_FAILED; return EINVALID_CMD_LINE;
} }
if (argc && arg_count(cmd, all_ARG)) { if (argc && arg_count(cmd, all_ARG)) {
log_error("No arguments permitted when using -a for all."); log_error("No arguments permitted when using -a for all.");
return ECMD_FAILED; return EINVALID_CMD_LINE;
} }
return process_each_vg(cmd, argc, argv, READ_FOR_UPDATE, NULL, return process_each_vg(cmd, argc, argv, READ_FOR_UPDATE, NULL,

View File

@ -60,12 +60,12 @@ int vgimport(struct cmd_context *cmd, int argc, char **argv)
{ {
if (!argc && !arg_count(cmd, all_ARG)) { if (!argc && !arg_count(cmd, all_ARG)) {
log_error("Please supply volume groups or use -a for all."); log_error("Please supply volume groups or use -a for all.");
return ECMD_FAILED; return EINVALID_CMD_LINE;
} }
if (argc && arg_count(cmd, all_ARG)) { if (argc && arg_count(cmd, all_ARG)) {
log_error("No arguments permitted when using -a for all."); log_error("No arguments permitted when using -a for all.");
return ECMD_FAILED; return EINVALID_CMD_LINE;
} }
if (arg_count(cmd, force_ARG)) { if (arg_count(cmd, force_ARG)) {