summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorRuediger Meier2017-06-25 00:19:50 +0200
committerRuediger Meier2017-06-27 12:26:19 +0200
commitb1a294c448582c5571fbf7c0d363357c88154016 (patch)
tree97a83cb04af7879473368edb259781ad02a89272 /include
parentmisc: revert to the old USAGE_HELP strings (diff)
downloadkernel-qcow2-util-linux-b1a294c448582c5571fbf7c0d363357c88154016.tar.gz
kernel-qcow2-util-linux-b1a294c448582c5571fbf7c0d363357c88154016.tar.xz
kernel-qcow2-util-linux-b1a294c448582c5571fbf7c0d363357c88154016.zip
misc: introduce print_usage_help_options()
Consolidate --help and --version descriptions. We are now able to align them to the other options. We changed include/c.h. The rest of this patch was generated by sed, plus manually setting the right alignment numbers. We do not change anything but white spaces in the --help output. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Diffstat (limited to 'include')
-rw-r--r--include/c.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/include/c.h b/include/c.h
index fe46b8c2d..94ebf7e7d 100644
--- a/include/c.h
+++ b/include/c.h
@@ -315,8 +315,18 @@ static inline int xusleep(useconds_t usec)
#define USAGE_COMMANDS _("\nCommands:\n")
#define USAGE_COLUMNS _("\nAvailable output columns:\n")
#define USAGE_SEPARATOR "\n"
-#define USAGE_HELP _(" -h, --help display this help and exit\n")
-#define USAGE_VERSION _(" -V, --version output version information and exit\n")
+
+#define USAGE_OPTSTR_HELP _("display this help and exit")
+#define USAGE_OPTSTR_VERSION _("output version information and exit")
+
+#define print_usage_help_options(marg_dsc) \
+ printf( \
+ "%-" #marg_dsc "s%s\n" \
+ "%-" #marg_dsc "s%s\n" \
+ , " -h, --help", USAGE_OPTSTR_HELP \
+ , " -V, --version", USAGE_OPTSTR_VERSION \
+ )
+
#define USAGE_MAN_TAIL(_man) _("\nFor more details see %s.\n"), _man
#define UTIL_LINUX_VERSION _("%s from %s\n"), program_invocation_short_name, PACKAGE_STRING