]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
ipcmk: cleanup usage()
authorKarel Zak <kzak@redhat.com>
Tue, 16 Aug 2011 11:34:22 +0000 (13:34 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 16 Aug 2011 11:34:42 +0000 (13:34 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
sys-utils/ipcmk.c

index 26bf8f6bcbea9615e675aba8f575e170852d6c88..5999f0f1c928908fffd3b40be6e97bb4a4c1e128 100644 (file)
@@ -81,13 +81,19 @@ int createSem(int nsems, int permission)
 
 void usage(int rc)
 {
-       printf(_("\nUsage: %s [options]\n\n"), progname);
-       printf(_(
-       "  -M <size>     create shared memory segment of size <size>\n"
-       "  -S <nsems>    create semaphore array with <nsems> elements\n"
-       "  -Q            create message queue\n"
-       "  -p <mode>     permission for the resource (default is 0644)\n"));
-       printf(_("\nFor more information see ipcmk(1).\n\n"));
+       FILE *out = rc == EXIT_FAILURE ? stderr : stdout;
+
+       fputs(_("\nUsage:\n"), out);
+       fprintf(out,
+            _(" %s [options]\n"), progname);
+
+       fputs(_("\nOptions:\n"), out);
+       fputs(_(" -M <size>     create shared memory segment of size <size>\n"
+               " -S <nsems>    create semaphore array with <nsems> elements\n"
+               " -Q            create message queue\n"
+               " -p <mode>     permission for the resource (default is 0644)\n"), out);
+
+       fputs(_("\nFor more information see ipcmk(1).\n"), out);
 
        exit(rc);
 }