SummaryRefsLogTreeCommitDiffStats
path: root/src/cron.in
diff options
context:
space:
mode:
authorDale Mellor <mcron-lsfnyl@rdmp.org>2020-05-08 20:43:50 +0100
committerDale Mellor <mcron-lsfnyl@rdmp.org>2022-07-07 22:06:44 +0100
commita0d493fa9be910187a00c6be1ccbf5ee50ffd040 (patch)
treebc8b005c3970d9b0f2debdcc005f72f3cd1ef6e6 /src/cron.in
parent5fd0ccde5a4cff70299999f988e6b5166584814d (diff)
downloadmcron-a0d493fa9be910187a00c6be1ccbf5ee50ffd040.tar.gz
mcron-a0d493fa9be910187a00c6be1ccbf5ee50ffd040.tar.bz2
mcron-a0d493fa9be910187a00c6be1ccbf5ee50ffd040.zip
Using proposed new Guile command-line-processor.
This is a pre-emptive delta which will make use of new facilities in a future Guile for command-line option processing---a fuller description will appear with later patches. * src/{cron,crontab,mcron}.in: use new facility * src/mcron/scripts/{cron,crontab,mcron}.scm: remove old option-scanning code
Diffstat (limited to 'src/cron.in')
-rw-r--r--src/cron.in47
1 files changed, 44 insertions, 3 deletions
diff --git a/src/cron.in b/src/cron.in
index be624e0..fc4725e 100644
--- a/src/cron.in
+++ b/src/cron.in
@@ -2,10 +2,51 @@
-*- scheme -*-
!#
+;;;; cron -- run jobs at scheduled times
+;;; Copyright © 2003, 2012, 2020, 2022 Dale Mellor <mcron-lsfnyl@rdmp.org>
+;;; Copyright © 2015, 2016, 2018 Mathieu Lirzin <mthl@gnu.org>
+;;;
+;;; This file is part of GNU Mcron.
+;;;
+;;; GNU Mcron is free software: you can redistribute it and/or modify
+;;; it under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation, either version 3 of the License, or
+;;; (at your option) any later version.
+;;;
+;;; GNU Mcron is distributed in the hope that it will be useful,
+;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Mcron. If not, see <http://www.gnu.org/licenses/>.
+
+
(unless (getenv "MCRON_UNINSTALLED")
(set! %load-path (cons "%modsrcdir%" %load-path))
(set! %load-compiled-path (cons "%modbuilddir%" %load-compiled-path)))
-(use-modules (mcron scripts cron))
-(use-modules (mcron utils))
-(catch-mcron-error (main))
+(use-modules (mcron scripts cron)
+ (ice-9 command-line-processor))
+
+(process-command-line (command-line)
+ application "cron"
+ version "%VERSION%"
+ usage "[OPTIONS]"
+ help-preamble
+ "Unless an option is specified, run a cron daemon as a detached process,"
+ "reading all the information in the usersʼ crontabs and in /etc/crontab."
+ option (--schedule=8 -s string->number
+ "display the next N (or 8) jobs that will be"
+ "run, and exit")
+ option (--noetc -n "do not check /etc/crontab for updates (use"
+ "of this option is HIGHLY RECOMMENDED)")
+ help-postamble
+ "Mandatory or optional arguments to long options are also mandatory or "
+ "optional for any corresponding short options."
+ bug-address "%PACKAGE_BUGREPORT%"
+ copyright "2003 - 2022 Free Software Foundation, Inc."
+ license GPLv3)
+
+
+(catch-mcron-error (main --schedule --noetc))