diff options
author | Mathieu Lirzin <mthl@gnu.org> | 2015-07-21 00:53:46 +0200 |
---|---|---|
committer | Mathieu Lirzin <mthl@gnu.org> | 2016-05-07 11:32:19 +0200 |
commit | 2dd8fa9d8f4cc23f4a02a41c2b7898e5c8143e54 (patch) | |
tree | d648e8fd9a7f51b1b89c083b98f5951dfbe13fd6 /scm/mcron/main.scm | |
parent | 607d5e060df87dccf3d8fd478250c3e8832f105b (diff) | |
download | mcron-2dd8fa9d8f4cc23f4a02a41c2b7898e5c8143e54.tar.gz mcron-2dd8fa9d8f4cc23f4a02a41c2b7898e5c8143e54.tar.bz2 mcron-2dd8fa9d8f4cc23f4a02a41c2b7898e5c8143e54.zip |
main: Add 'show-version' procedure.
* scm/mcron/main.scm (show-version): New procedure.
Diffstat (limited to 'scm/mcron/main.scm')
-rw-r--r-- | scm/mcron/main.scm | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/scm/mcron/main.scm b/scm/mcron/main.scm index 36adef9..db321cf 100644 --- a/scm/mcron/main.scm +++ b/scm/mcron/main.scm @@ -1,3 +1,4 @@ +;; Copyright (C) 2015, 2016 Mathieu Lirzin ;; Copyright (C) 2003, 2012 Dale Mellor ;; ;; This file is part of GNU mcron. @@ -122,25 +123,25 @@ (lambda (key func fmt args . rest) (mcron-error 1 (apply format (append (list #f fmt) args)))))) -;; If the user asked for the version of this program, give it to him and get +(define* (show-version #:optional (command command-name)) + "Display version information for COMMAND and quit." + (let* ((name config-package-name) + (short-name (cadr (string-split name #\space))) + (version config-package-version)) + (simple-format #t "~a (~a) ~a\n +Copyright (C) 2015 the ~a authors.\n +License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\n +This is free software: you are free to change and redistribute it.\n +There is NO WARRANTY, to the extent permitted by law.\n" + command name version short-name) + (quit))) + +(when (option-ref options 'version #f) + (show-version)) + +;; If the user asked for the help text of this program, give it to him and get ;; out. -(if (option-ref options 'version #f) - (begin - (display (string-append "\n -" command-name " (" config-package-string ")\n -Written by Dale Mellor\n -\n -Copyright (C) 2003, 2006, 2014 Dale Mellor\n -This is free software; see the source for copying conditions. There is NO\n -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n -")) - (quit))) - - - -;; Likewise if the user requested the help text. - (if (option-ref options 'help #f) (begin (display (string-append " |