[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug-mcron] [PATCH 06/33] main: Add show-help.
From: |
Mathieu Lirzin |
Subject: |
[Bug-mcron] [PATCH 06/33] main: Add show-help. |
Date: |
Sun, 27 Sep 2015 22:41:51 +0200 |
* scm/mcron/main.scm (show-help): New procedure.
---
scm/mcron/main.scm | 50 ++++++++++++++++++++++----------------------------
1 file changed, 22 insertions(+), 28 deletions(-)
diff --git a/scm/mcron/main.scm b/scm/mcron/main.scm
index 9de0890..53fed6d 100644
--- a/scm/mcron/main.scm
+++ b/scm/mcron/main.scm
@@ -148,17 +148,13 @@ General help using GNU software:
<http://www.gnu.org/gethelp/>\n"
config-package-name
config-package-url))
-;; If the user asked for the help text of this program, give it to him and get
-;; out.
-
-(if (option-ref options 'help #f)
- (begin
- (display (string-append "
-Usage: " (car (command-line))
-(case command-type
-
- ((mcron)
-" [OPTIONS] [FILES]\n
+(define* (show-help #:optional (command command-name))
+ "Display informations of usage for COMMAND and quit."
+ (simple-format #t "Usage: ~a" command)
+ (display
+ (case command-type
+ ((mcron)
+ " [OPTIONS] [FILES]\n
Run an mcron process according to the specifications in the FILES (`-' for\n
standard input), or use all the files in ~/.config/cron (or the \n
deprecated ~/.cron) with .guile or .vixie extensions.\n
@@ -170,9 +166,8 @@ deprecated ~/.cron) with .guile or .vixie extensions.\n
and run as a daemon process\n
-i, --stdin=(guile|vixie) Format of data passed as standard input or\n
file arguments (default guile)")
-
- ((cron)
-" [OPTIONS]\n
+ ((cron)
+ " [OPTIONS]\n
Unless an option is specified, run a cron daemon as a detached process, \n
reading all the information in the users' crontabs and in /etc/crontab.\n
\n
@@ -181,21 +176,20 @@ reading all the information in the users' crontabs and in
/etc/crontab.\n
-sN, --schedule[=]N Display the next N jobs that will be run by cron\n
-n, --noetc Do not check /etc/crontab for updates (HIGHLY\n
RECOMMENDED).")
-
- ((crontab)
- (string-append " [-u user] file\n"
- " " (car (command-line)) " [-u user] { -e | -l | -r }\n"
- " (default operation is replace, per 1003.2)\n"
- " -e (edit user's crontab)\n"
- " -l (list user's crontab)\n"
- " -r (delete user's crontab)\n"))
-
- (else "rubbish"))))
- (newline)
- (show-package-information)
- (quit)))
-
+ ((crontab)
+ " [-u user] file\n
+ crontab [-u user] { -e | -l | -r }\n
+ (default operation is replace, per 1003.2)\n
+ -e (edit user's crontab)\n
+ -l (list user's crontab)\n
+ -r (delete user's crontab")
+ (else "\nrubbish")))
+ (newline)
+ (show-package-information)
+ (quit))
+(when (option-ref options 'help #f)
+ (show-help))
;; This is called from the C front-end whenever a terminal signal is
;; received. We remove the /var/run/cron.pid file so that crontab and other
- [Bug-mcron] [PATCH 00/33] Remove 'ed' hack and apply various cleanups., Mathieu Lirzin, 2015/09/27
- [Bug-mcron] [PATCH 01/33] Augment '.gitignore'., Mathieu Lirzin, 2015/09/27
- [Bug-mcron] [PATCH 02/33] doc: Include a copy of the GNU FDL., Mathieu Lirzin, 2015/09/27
- [Bug-mcron] [PATCH 03/33] build: Add package variables., Mathieu Lirzin, 2015/09/27
- [Bug-mcron] [PATCH 06/33] main: Add show-help.,
Mathieu Lirzin <=
- [Bug-mcron] [PATCH 05/33] main: Add show-package-information., Mathieu Lirzin, 2015/09/27
- [Bug-mcron] [PATCH 04/33] main: Add show-version., Mathieu Lirzin, 2015/09/27
- [Bug-mcron] [PATCH 08/33] build: Improve maintainer-clean rule., Mathieu Lirzin, 2015/09/27
- [Bug-mcron] [PATCH 07/33] Augment TODO., Mathieu Lirzin, 2015/09/27
- [Bug-mcron] [PATCH 09/33] build: Generate 'ChangeLog' upon 'make dist'., Mathieu Lirzin, 2015/09/27
- [Bug-mcron] [PATCH 10/33] build: Fix prerequisite of the man page target., Mathieu Lirzin, 2015/09/27
- [Bug-mcron] [PATCH 11/33] main: Import the modules used in one time., Mathieu Lirzin, 2015/09/27
- [Bug-mcron] [PATCH 12/33] main: Use 'when' and 'unless' special forms., Mathieu Lirzin, 2015/09/27
- [Bug-mcron] [PATCH 14/33] main: Make 'catch-mcron-error' macro hygienic., Mathieu Lirzin, 2015/09/27