Skip to contentSkip to conversation

master - commands: recognize lvm command -?

PATCH David Teigland 1 participant 1 message Aug 9, 2017

lore
Share & tools
lore
#0 lore raw
Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=955083e625eb003090ce8f699e8d414a215cce1f
Commit:        955083e625eb003090ce8f699e8d414a215cce1f
Parent:        8bc89658476d187a6b1d40018bbbac84d389c5be
Author:        David Teigland <[email protected]>
AuthorDate:    Wed Aug 9 15:06:36 2017 -0500
Committer:     David Teigland <[email protected]>
CommitterDate: Wed Aug 9 15:06:36 2017 -0500

commands: recognize lvm command -?

and interpret it as lvm command -h

---
 tools/lvmcmdline.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
tools/lvmcmdline.c +3 -1
index cc1c297..55f72ac 100644
@@ -3465,9 +3465,11 @@ int lvm2_main(int argc, char **argv)
 		}
 	}
 
-	/* turn command -? into command -h */
+	/* turn command -? into command -h and lvm command -? into lvm command -h */
 	if (alias && (argc > 1) && !strcmp(argv[1], "-?"))
 		argv[1] = (char *)"-h";
+	if (!alias && (argc > 2) && !strcmp(argv[2], "-?"))
+		argv[2] = (char *)"-h";
 
 	if (!(cmd = init_lvm(0, 0)))
 		return EINIT_FAILED;