Skip to contentSkip to conversation

master - lvdiplay: prohibit use of -c and -m

PATCH Zdenek Kabelac 1 participant 1 message Mar 31, 2014

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=caa429da2e58ad65ecfc8836f5f64c54395a8793
Commit:        caa429da2e58ad65ecfc8836f5f64c54395a8793
Parent:        8f9150c241f80b2fd69d2e416340707759e79ac8
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Mon Mar 31 10:04:24 2014 +0200
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Mon Mar 31 12:00:45 2014 +0200

lvdiplay: prohibit use of -c and -m

It's unclear why we should prohibit use of -v output. So reenable (like with other 'display' tools) But -c -m is really unsupported - return invalid cmd.

---
 WHATS_NEW         |    1 +
 tools/lvdisplay.c |    4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)
WHATS_NEW +1 -0
index 0decc72..b5ee541 100644
@@ -1,5 +1,6 @@
 Version 2.02.106 - 
 ====================================
+  Add explict error message when using lvdisplay -c -m.
   Update man pages for pv/vg/lvdisplay.
   Report error when running pvscan with free argument (i.e. PV name).
   Fix error message for pvdisplay -c -m and add new for pvdisplay -c -s.
tools/lvdisplay.c +2 -2
index f5531cb..246e43b 100644
@@ -49,8 +49,8 @@ int lvdisplay(struct cmd_context *cmd, int argc, char **argv)
 		return EINVALID_CMD_LINE;
 	}
 
-	if (arg_count(cmd, colon_ARG) && arg_count(cmd, verbose_ARG)) {
-		log_error("Options -v and -c are incompatible");
+	if (arg_count(cmd, colon_ARG) && arg_count(cmd, maps_ARG)) {
+		log_error("Options -c and -m are incompatible.");
 		return EINVALID_CMD_LINE;
 	}