]> granicus.if.org Git - cronie/commitdiff
anacron: clean up usage() output
authorSami Kerola <kerolasa@iki.fi>
Sat, 1 Dec 2012 19:13:49 +0000 (19:13 +0000)
committerTomas Mraz <tmraz@fedoraproject.org>
Fri, 21 Dec 2012 20:54:29 +0000 (21:54 +0100)
Inform in usage which options will need arguments, and add reference to
manual page.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
anacron/main.c

index 5194c5bdd60a50b9ceb6156c7388b3db2e3ec26c..2c55716e6d65e65ec833462fcdb30aedc44d9889 100644 (file)
@@ -79,25 +79,22 @@ print_version()
 static void
 print_usage()
 {
-    printf("Usage:  anacron [-s] [-f] [-n] [-d] [-q] [-t anacrontab] [-S spooldir] [job] ...\n"
-          "        anacron [-S spooldir] -u [job] ...\n"
-          "        anacron [-V|-h]\n"
-          "        anacron -T [-t anacrontab]\n"
-          "\n"
-          " -s  Serialize execution of jobs\n"
-          " -f  Force execution of jobs, even before their time\n"
-          " -n  Run jobs with no delay, implies -s\n"
-          " -d  Don't fork to the background\n"
-          " -q  Suppress stderr messages, only applicable with -d\n"
-          " -u  Update the timestamps without actually running anything\n"
-          " -t  Use this anacrontab\n"
-          " -V  Print version information\n"
-          " -h  Print this message\n"
-          " -T  Test an anacrontab\n"
-          " -S  Select a different spool directory\n"
-          "\n"
-          "See the manpage for more details.\n"
-          "\n");
+    printf("Usage:\n");
+    printf(" %s [options] [job] ...\n", program_name);
+    printf(" %s -T [-t anacrontab-file]\n", program_name);
+    printf("\nOptions:\n");
+    printf(" -s         Serialize execution of jobs\n");
+    printf(" -f         Force execution of jobs, even before their time\n");
+    printf(" -n         Run jobs with no delay, implies -s\n");
+    printf(" -d         Don't fork to the background\n");
+    printf(" -q         Suppress stderr messages, only applicable with -d\n");
+    printf(" -u         Update the timestamps without actually running anything\n");
+    printf(" -V         Print version information\n");
+    printf(" -h         Print this message\n");
+    printf(" -t <file>  Use alternative anacrontab\n");
+    printf(" -T         Test an anacrontab\n");
+    printf(" -S <dir>   Select a different spool directory\n");
+    printf("\nSee the anacron(8) manpage for more details.\n");
 }
 
 static void