SummaryRefsLogTreeCommitDiffStats
diff options
context:
space:
mode:
authorDale Mellor <hydro23@.(none)>2008-01-25 21:59:21 +0000
committerDale Mellor <dale@rdmp.org>2010-06-12 20:53:22 +0100
commiteb041a75325650e3953c5cc2ad70172e93283d3b (patch)
tree3f67c738ed298e6660d33f900b7457ed31dc7427
parent651f3b4a6bf78c87a1ab453f8489441b919a1ca3 (diff)
downloadmcron-eb041a75325650e3953c5cc2ad70172e93283d3b.tar.gz
mcron-eb041a75325650e3953c5cc2ad70172e93283d3b.tar.bz2
mcron-eb041a75325650e3953c5cc2ad70172e93283d3b.zip
The --schedule argument is no longer optional.
-rw-r--r--ChangeLog5
-rw-r--r--main.scm18
2 files changed, 11 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index 2547e37..8fb1eb7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2008-01-25 Dale Mellor <Dale Mellor <dale_mellor@users.sourceforge.net>>
+ * main.scm: Argument to --schedule is no longer optional (the
+ options system goes really screwy with optional values, usually
+ pulling the first non-option argument as a value if one was not
+ intended!)
+
* makefile.am: Moved target-specific CFLAGS and LDFLAGS to global
AM_* variables, to remove problem with automake requiring
AM_PROGS_CC_C_O in configure.ac (!)
diff --git a/main.scm b/main.scm
index 9017276..9424736 100644
--- a/main.scm
+++ b/main.scm
@@ -106,12 +106,10 @@
(edit (single-char #\e) (value #f))
(list (single-char #\l) (value #f))
(remove (single-char #\r) (value #f))))
- (else `((schedule (single-char #\s)
- (value optional)
- (predicate ;; Added by Sergey Poznyakoff.
+ (else `((schedule (single-char #\s) (value #t)
+ (predicate
,(lambda (value)
- (or (eq? value #t)
- (string->number value)))))
+ (string->number value))))
(daemon (single-char #\d) (value #f))
(noetc (single-char #\n) (value #f))
(stdin (single-char #\i) (value #t)
@@ -157,8 +155,7 @@ extensions.\n
\n
-v, --version Display version\n
-h, --help Display this help message\n
- -s, --schedule[=COUNT] Display the next COUNT jobs (default 8) that\n
- will be run by mcron\n
+ -sN, --schedule[=]N Display the next N jobs that will be run by mcron\n
-d, --daemon Immediately detach the program from the terminal and\n
run as a daemon process\n
-i, --stdin=(guile|vixie) Format of data passed as standard input or\n
@@ -171,8 +168,7 @@ reading all the information in the users' crontabs and in /etc/crontab.\n
\n
-v, --version Display version\n
-h, --help Display this help message\n
- -s, --schedule[=COUNT] Display the next COUNT jobs (default 8) that\n
- will be run by cron\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).")
@@ -403,9 +399,7 @@ option.\n")
;; count is some positive integer.
(and-let* ((count (option-ref options 'schedule #f)))
- (set! count (if (eq? count #t)
- 8
- (string->number count)))
+ (set! count (string->number count))
(display (get-schedule (if (<= count 0) 1 count)))
(quit))