[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug-mcron] [PATCH 04/33] main: Add show-version.
From: |
Mathieu Lirzin |
Subject: |
[Bug-mcron] [PATCH 04/33] main: Add show-version. |
Date: |
Sun, 27 Sep 2015 22:41:49 +0200 |
* scm/mcron/main.scm (show-version): New procedure.
---
scm/mcron/main.scm | 35 ++++++++++++++++++-----------------
1 file changed, 18 insertions(+), 17 deletions(-)
diff --git a/scm/mcron/main.scm b/scm/mcron/main.scm
index 36adef9..ad4acd9 100644
--- a/scm/mcron/main.scm
+++ b/scm/mcron/main.scm
@@ -1,3 +1,4 @@
+;; Copyright (C) 2015 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 "
- [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, 2015/09/27
- [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 <=
- [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
- [Bug-mcron] [PATCH 16/33] main: Add cron-file-descriptors., Mathieu Lirzin, 2015/09/27
- [Bug-mcron] [PATCH 27/33] main: Improve 'process-user-file' definition., Mathieu Lirzin, 2015/09/27