diff options
author | Ludovic Courtès <ludo@gnu.org> | 2009-08-15 12:53:59 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2009-08-15 14:18:57 +0200 |
commit | 54b38caf19deb0e5a6e8146c65b3e176e7fffa60 (patch) | |
tree | 5432bacb46329c9fd823fb9cea9c08e7805aa4ce /module/scripts/compile.scm | |
parent | acf04ab4621d9b558f0c403897d36ef9369d1dfc (diff) | |
download | guile-54b38caf19deb0e5a6e8146c65b3e176e7fffa60.tar.gz |
Add proper `--help' and `--version' for `guile-tools compile'.
* configure.ac: Produce `meta/guile-tools'.
* meta/Makefile.am (EXTRA_DIST): Add `guile-tools.in'.
(bin_SCRIPTS): Remove `guile-tools'.
* meta/uninstalled-env.in (PATH): Add "${top_builddir}/meta".
* module/scripts/compile.scm (%options): Add `--version'.
(parse-args): Show the offending option name upon error.
(show-version): New.
(compile): Use `%guile-bug-report-address'.
Diffstat (limited to 'module/scripts/compile.scm')
-rw-r--r-- | module/scripts/compile.scm | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/module/scripts/compile.scm b/module/scripts/compile.scm index 89d35bcb5..9b14f2fca 100644 --- a/module/scripts/compile.scm +++ b/module/scripts/compile.scm @@ -48,6 +48,10 @@ (list (option '(#\h "help") #f #f (lambda (opt name arg result) (alist-cons 'help? #t result))) + (option '("version") #f #f + (lambda (opt name arg result) + (show-version) + (exit 0))) (option '(#\L "load-path") #t #f (lambda (opt name arg result) @@ -90,7 +94,7 @@ options." (args-fold args %options (lambda (opt name arg result) - (format (current-error-port) "~A: unrecognized option" opt) + (format (current-error-port) "~A: unrecognized option" name) (exit 1)) (lambda (file result) (let ((input-files (assoc-ref result 'input-files))) @@ -102,6 +106,13 @@ options." (load-path) (warnings unsupported-warning)))) +(define (show-version) + (format #t "compile (GNU Guile) ~A~%" (version)) + (format #t "Copyright (C) 2009 Free Software Foundation, Inc. +License LGPLv3+: GNU LGPL version 3 or later <http://gnu.org/licenses/lgpl.html>. +This is free software: you are free to change and redistribute it. +There is NO WARRANTY, to the extent permitted by law.~%")) + (define (show-warning-help) (format #t "The available warning types are:~%~%") (for-each (lambda (wt) @@ -143,7 +154,8 @@ Compile each Guile source file FILE into a Guile object. Note that autocompilation will be turned off. -Report bugs to <guile-user@gnu.org>.~%") +Report bugs to <~A>.~%" + %guile-bug-report-address) (exit 0))) (set! %load-path (append load-path %load-path)) |