From cf29de5de0a39ade491e18c1fe0e8bd3c2937b08 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Sun, 30 Mar 2014 22:38:51 +0200 Subject: [PATCH] vgimport/vgexport: return invalid cmd When option parsing fails, return invalid cmd instead of fail. --- WHATS_NEW | 1 + tools/vgexport.c | 4 ++-- tools/vgimport.c | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/WHATS_NEW b/WHATS_NEW index 626a5b804..dc0d1b45b 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ 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. Add man page for lvm dumpconfig. Drop unused cmd pointer for internal function for_each_sub_lv(). diff --git a/tools/vgexport.c b/tools/vgexport.c index c573619de..ad658f8f2 100644 --- a/tools/vgexport.c +++ b/tools/vgexport.c @@ -56,12 +56,12 @@ int vgexport(struct cmd_context *cmd, int argc, char **argv) { if (!argc && !arg_count(cmd, all_ARG)) { 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)) { 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, diff --git a/tools/vgimport.c b/tools/vgimport.c index 3a0798a7e..7cb93378f 100644 --- a/tools/vgimport.c +++ b/tools/vgimport.c @@ -60,12 +60,12 @@ int vgimport(struct cmd_context *cmd, int argc, char **argv) { if (!argc && !arg_count(cmd, all_ARG)) { 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)) { log_error("No arguments permitted when using -a for all."); - return ECMD_FAILED; + return EINVALID_CMD_LINE; } if (arg_count(cmd, force_ARG)) {