Skip to contentSkip to conversation

master - commands: improve help/usage output

PATCH David Teigland 1 participant 1 message Feb 14, 2017

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=f46b28bdb6f8c0f7bae7a8b4fb4b886332831318
Commit:        f46b28bdb6f8c0f7bae7a8b4fb4b886332831318
Parent:        c868562a7968db9b0d00df9b1d0a8967a9aacaa3
Author:        David Teigland <[email protected]>
AuthorDate:    Tue Feb 14 09:49:26 2017 -0600
Committer:     David Teigland <[email protected]>
CommitterDate: Tue Feb 14 09:52:09 2017 -0600

commands: improve help/usage output

Replace --help --help with --long-help. Some blank lines were needed.
Add 'lvm help all' to print help for all commands.

---
 tools/args.h           |    7 +++-
 tools/command-lines.in |    2 +-
 tools/command.c        |    5 ++-
 tools/lvmcmdline.c     |   95 ++++++++++++++++++++++++++++--------------------
 4 files changed, 64 insertions(+), 45 deletions(-)
tools/args.h +5 -2
index b33df9a..f64b126 100644
@@ -244,6 +244,9 @@ arg(locktype_ARG, '\0', "locktype", locktype_VAL, 0, 0,
 arg(logonly_ARG, '\0', "logonly", 0, 0, 0,
     "Suppress command report and display only log report.\n")
 
+arg(longhelp_ARG, '\0', "longhelp", 0, 0, 0,
+    "Display long help text.\n")
+
 arg(maxrecoveryrate_ARG, '\0', "maxrecoveryrate", sizekb_VAL, 0, 0,
     "Sets the maximum recovery rate for a RAID LV.  The rate value\n"
     "is an amount of data per second for each device in the array.\n"
@@ -920,8 +923,8 @@ arg(force_ARG, 'f', "force", 0, ARG_COUNTABLE, 0,
 /* Not used. */
 arg(full_ARG, 'f', "full", 0, 0, 0, NULL)
 
-arg(help_ARG, 'h', "help", 0, ARG_COUNTABLE, 0,
-    "Display help text. Repeat this option for more information.\n")
+arg(help_ARG, 'h', "help", 0, 0, 0,
+    "Display help text.\n")
 
 arg(cache_ARG, 'H', "cache", 0, 0, 0,
     "Specifies the command is handling a cache LV or cache pool.\n"
tools/command-lines.in +1 -1
index 2eddd41..b6aa1d1 100644
@@ -187,7 +187,7 @@
 # OO_ALL is included in every command automatically.
 #
 OO_ALL: --commandprofile String, --config String, --debug,
---driverloaded Bool, --help, --profile String, --quiet,
+--driverloaded Bool, --help, --longhelp, --profile String, --quiet,
 --verbose, --version, --yes, --test
 
 #
tools/command.c +3 -2
index 0ff5cd7..a968bed 100644
@@ -1640,7 +1640,7 @@ void print_usage(struct command *cmd)
 
 	printf(" ]");
  done:
-	printf("\n");
+	printf("\n\n");
 	return;
 }
 
@@ -1704,7 +1704,8 @@ void print_usage_common(struct command_name *cname, struct command *cmd)
 		}
 	}
 
-	printf(" ]\n");
+	printf(" ]");
+	printf("\n\n");
 }
 
 #ifdef MAN_PAGE_GENERATOR
tools/lvmcmdline.c +55 -40

138 lines not on this page · raw message