]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
flock: align with howto-usage-function.txt
authorSami Kerola <kerolasa@iki.fi>
Wed, 21 Sep 2011 19:27:42 +0000 (21:27 +0200)
committerSami Kerola <kerolasa@iki.fi>
Thu, 29 Sep 2011 20:45:20 +0000 (22:45 +0200)
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
sys-utils/flock.c

index 334d2a89915c6a1ff46192d5762c9544cab0bb8b..560dfb26aab9d9739db732ebded3f18d1141aa1b 100644 (file)
 
 static void usage(int ex)
 {
-       fputs(_("\nUsage:\n"), stderr);
+       fprintf(stderr, USAGE_HEADER);
        fprintf(stderr,
-               _(" %1$s [-sxun][-w #] fd#\n"
-                 " %1$s [-sxon][-w #] file [-c] command...\n"
-                 " %1$s [-sxon][-w #] directory [-c] command...\n"),
+               _(" %1$s [options] <file descriptor number>\n"
+                 " %1$s [options] <file> -c <command>\n"
+                 " %1$s [options} <directory> -c <command>\n"),
                program_invocation_short_name);
-
-       fputs(_("\nOptions:\n"), stderr);
-       fputs(_(" -s  --shared     Get a shared lock\n"
-               " -x  --exclusive  Get an exclusive lock\n"
-               " -u  --unlock     Remove a lock\n"
-               " -n  --nonblock   Fail rather than wait\n"
-               " -w  --timeout    Wait for a limited amount of time\n"
-               " -o  --close      Close file descriptor before running command\n"
-               " -c  --command    Run a single command string through the shell\n"
-               " -h  --help       Display this text\n"
-               " -V  --version    Display version\n\n"), stderr);
+       fputs(USAGE_OPTIONS, stderr);
+       fputs(_(  " -s  --shared             get a shared lock\n"), stderr);
+       fputs(_(  " -x  --exclusive          get an exclusive lock (default)\n"), stderr);
+       fputs(_(  " -u  --unlock             remove a lock\n"), stderr);
+       fputs(_(  " -n  --nonblock           fail rather than wait\n"), stderr);
+       fputs(_(  " -w  --timeout <secs>     wait for a limited amount of time\n"), stderr);
+       fputs(_(  " -o  --close              close file descriptor before running command\n"), stderr);
+       fputs(_(  " -c  --command <command>  run a single command string through the shell\n"), stderr);
+       fprintf(stderr, USAGE_SEPARATOR);
+       fprintf(stderr, USAGE_HELP);
+       fprintf(stderr, USAGE_VERSION);
+       fprintf(stderr, USAGE_MAN_TAIL("flock(1)"));
        exit(ex);
 }