[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] GNU Guile branch, master, updated. release_1-9-11-318-g0

From: Andy Wingo
Subject: [Guile-commits] GNU Guile branch, master, updated. release_1-9-11-318-g0f6611f
Date: Sat, 04 Sep 2010 17:57:26 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Guile".

The branch, master has been updated
       via  0f6611fb8b31c57ec4f2cff810e6063dc7c33b43 (commit)
      from  76aea207c805dca8a0f086bbe8edd48e294aa46f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 0f6611fb8b31c57ec4f2cff810e6063dc7c33b43
Author: Andy Wingo <address@hidden>
Date:   Sat Sep 4 11:00:33 2010 -0700

    fix guile-tools --help and --version
    * meta/ Fix --help and --version.


Summary of changes:
 meta/ |   34 ++++++++++++++++++++++++++++------
 1 files changed, 28 insertions(+), 6 deletions(-)

diff --git a/meta/ b/meta/
index 74870ff..28ef1ba 100755
--- a/meta/
+++ b/meta/
@@ -39,7 +39,7 @@ exec guile $GUILE_FLAGS -e '(@@ (guile-tools) main)' -s "$0" 
       (fold kons (kons (car seq) seed) (cdr seq))))
-(define (help)
+(define (display-help)
   (display "\
 Usage: guile-tools --version
        guile-tools --help
@@ -49,6 +49,14 @@ If PROGRAM is \"list\" or omitted, display available 
scripts, otherwise
 PROGRAM is run with ARGS.
+(define (display-version)
+  (format #t "guile-tools (GNU Guile ~A) ~A
+Copyright (C) 2010 Free Software Foundation, Inc.
+License LGPLv3+: GNU LGPL version 3 or later 
+This is free software: you are free to change and redistribute it.
+There is NO WARRANTY, to the extent permitted by law.
+" (version) (effective-version)))
 (define (directory-files dir)
   (if (and (file-exists? dir) (file-is-directory? dir))
       (let ((dir-stream (opendir dir)))
@@ -110,8 +118,22 @@ PROGRAM is run with ARGS.
 (define (main args)
   (setlocale LC_ALL "")
-  (if (or (equal? (cdr args) '())
-          (equal? (cdr args) '("list")))
-      (list-scripts)
-      (let ((mod (find-script (cadr args))))
-        (exit (apply (module-ref mod 'main) (cddr args))))))
+  (cond
+   ((or (equal? (cdr args) '())
+        (equal? (cdr args) '("list")))
+    (list-scripts))
+   ((string-prefix? "-" (cadr args))
+    (let ((option (cadr args)))
+      (cond
+       ((equal? option "--help")
+        (display-help)
+        (exit 0))
+       ((equal? option "--version")
+        (display-version)
+        (exit 0))
+       (else
+        (format (current-error-port) "Unrecognized option: ~an" option)
+        (exit 1)))))
+   (else
+    (let ((mod (find-script (cadr args))))
+      (exit (apply (module-ref mod 'main) (cddr args)))))))

GNU Guile

reply via email to

[Prev in Thread] Current Thread [Next in Thread]