]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
hwclock: add usage() functions heading
authorJ William Piggott <elseifthen@gmx.com>
Sat, 17 Jun 2017 19:32:28 +0000 (15:32 -0400)
committerJ William Piggott <elseifthen@gmx.com>
Tue, 20 Jun 2017 23:50:38 +0000 (19:50 -0400)
Make a functions heading, similar to the existing options heading.

* include/c.h: define USAGE_FUNCTIONS
* Documentation/boilerplate.c: add USAGE_FUNCTIONS
* sys-utils/hwclock.c add functions header to usage()

Reviewed-by: Karel Zak <kzak@redhat.com>
Signed-off-by: J William Piggott <elseifthen@gmx.com>
Documentation/boilerplate.c
include/c.h
sys-utils/hwclock.c

index 7da9374d47c54a472b28483748cacd7df7ac2839..057893bfb3c85428ef66fa3526b8646fa53f6bd3 100644 (file)
@@ -33,6 +33,9 @@ static void __attribute__((__noreturn__)) usage(FILE *out)
 {
        fputs(USAGE_HEADER, out);
        fprintf(out, _(" %s [options] file...\n"), program_invocation_short_name);
+       fputs(USAGE_FUNCTIONS, out);
+       fputs(_(" -s, --do-something      some specific task\n"), out);
+       fputs(_(" -o, --do-other          some different task\n"), out);
        fputs(USAGE_OPTIONS, out);
        fputs(_(" -n, --no-argument       option does not use argument\n"), out);
        fputs(_("     --optional[=<arg>]  option argument is optional\n"), out);
index a5162b96403d3bdf347aa1dcc8724e682d9dcdc5..b9369c1a85add29a7f4eff544c2e339ce73b4918 100644 (file)
@@ -317,6 +317,7 @@ static inline int xusleep(useconds_t usec)
  */
 #define USAGE_HEADER     _("\nUsage:\n")
 #define USAGE_OPTIONS    _("\nOptions:\n")
+#define USAGE_FUNCTIONS  _("\nFunctions:\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")
index 28655b0b9a916e7a4d619d335102db5fb9a8c7fc..9d6bb11c07c0fc5dd126bd5a510aef13788ef55d 100644 (file)
@@ -1208,8 +1208,7 @@ usage(const struct hwclock_control *ctl, FILE *out)
        fputs(USAGE_SEPARATOR, out);
        fputs(_(" Query or set the hardware clock\n"), out);
 
-       fputs(USAGE_SEPARATOR, out);
-       fputs(_("Functions:\n"), out);
+       fputs(USAGE_FUNCTIONS, out);
        fputs(_(" -r, --show           read hardware clock and print result\n"
                "     --get            read hardware clock and print drift corrected result\n"
                "     --set            set the RTC to the time given with --date\n"), out);