main: Add 'show-version' procedure.
* scm/mcron/main.scm (show-version): New procedure.
This commit is contained in:
		
					parent
					
						
							
								607d5e060d
							
						
					
				
			
			
				commit
				
					
						2dd8fa9d8f
					
				
			
		
					 1 changed files with 18 additions and 17 deletions
				
			
		|  | @ -1,3 +1,4 @@ | ||||||
|  | ;;   Copyright (C) 2015, 2016 Mathieu Lirzin | ||||||
| ;;   Copyright (C) 2003, 2012 Dale Mellor | ;;   Copyright (C) 2003, 2012 Dale Mellor | ||||||
| ;;  | ;;  | ||||||
| ;;   This file is part of GNU mcron. | ;;   This file is part of GNU mcron. | ||||||
|  | @ -122,24 +123,24 @@ | ||||||
|    (lambda (key func fmt args . rest) |    (lambda (key func fmt args . rest) | ||||||
|      (mcron-error 1 (apply format (append (list #f fmt) args)))))) |      (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)) | ||||||
| ;; out. |   "Display version information for COMMAND and quit." | ||||||
| 
 |   (let* ((name       config-package-name) | ||||||
| (if (option-ref options 'version #f) |          (short-name (cadr (string-split name #\space))) | ||||||
|     (begin |          (version    config-package-version)) | ||||||
|       (display (string-append "\n |     (simple-format #t "~a (~a) ~a\n | ||||||
| " command-name "  (" config-package-string ")\n | Copyright (C) 2015 the ~a authors.\n | ||||||
| Written by Dale Mellor\n | License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\n | ||||||
| \n | This is free software: you are free to change and redistribute it.\n | ||||||
| Copyright (C) 2003, 2006, 2014  Dale Mellor\n | There is NO WARRANTY, to the extent permitted by law.\n" | ||||||
| This is free software; see the source for copying conditions.  There is NO\n | 		   command name version short-name) | ||||||
| warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n |  | ||||||
| ")) |  | ||||||
|     (quit))) |     (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 | ||||||
| ;; Likewise if the user requested the help text. | ;; out. | ||||||
| 
 | 
 | ||||||
| (if (option-ref options 'help #f) | (if (option-ref options 'help #f) | ||||||
|     (begin |     (begin | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Mathieu Lirzin
				Mathieu Lirzin