guile-commits
[Top][All Lists]
Advanced

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

[Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.2-18-gd322dc


From: Andy Wingo
Subject: [Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.2-18-gd322dc9
Date: Sat, 23 Jul 2011 14:29:36 +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".

http://git.savannah.gnu.org/cgit/guile.git/commit/?id=d322dc92ec8170320c68abc024eb683a0bf8ab00

The branch, stable-2.0 has been updated
       via  d322dc92ec8170320c68abc024eb683a0bf8ab00 (commit)
       via  5d48015adf47dad962b77bf464b352e7fd2aead6 (commit)
      from  9957641b603f79b070fc2be0bf511235fa764229 (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 d322dc92ec8170320c68abc024eb683a0bf8ab00
Author: Andy Wingo <address@hidden>
Date:   Sat Jul 23 13:54:28 2011 +0200

    remove scripts PROGRAM
    
    * module/scripts/PROGRAM.scm: Remove this useless template, which was
      cluttering `guild list'.  We'll perhaps cull the list a bit more in
      2.2.
    
    * module/Makefile.am: Adapt.

commit 5d48015adf47dad962b77bf464b352e7fd2aead6
Author: Andy Wingo <address@hidden>
Date:   Sat Jul 23 13:52:51 2011 +0200

    a prettier `guild list'
    
    * module/scripts/list.scm (strip-extensions): Don't list programs
      without extensions.
      (main): Be prettier.  Parse out a %summary from modules, for a brief
      synopsis.

-----------------------------------------------------------------------

Summary of changes:
 module/Makefile.am         |    1 -
 module/scripts/PROGRAM.scm |   40 ----------------------------------------
 module/scripts/list.scm    |   37 +++++++++++++++++++++++++++++++------
 3 files changed, 31 insertions(+), 47 deletions(-)
 delete mode 100644 module/scripts/PROGRAM.scm

diff --git a/module/Makefile.am b/module/Makefile.am
index 2357e19..33d70bd 100644
--- a/module/Makefile.am
+++ b/module/Makefile.am
@@ -146,7 +146,6 @@ BRAINFUCK_LANG_SOURCES =                    \
   language/brainfuck/spec.scm
 
 SCRIPTS_SOURCES =                              \
-  scripts/PROGRAM.scm                          \
   scripts/autofrisk.scm                                \
   scripts/compile.scm                          \
   scripts/disassemble.scm                      \
diff --git a/module/scripts/PROGRAM.scm b/module/scripts/PROGRAM.scm
deleted file mode 100644
index 56e5cf3..0000000
--- a/module/scripts/PROGRAM.scm
+++ /dev/null
@@ -1,40 +0,0 @@
-;;; PROGRAM --- Does something
-
-;;     Copyright (C) 2002, 2006 Free Software Foundation, Inc.
-;;
-;; This program is free software; you can redistribute it and/or
-;; modify it under the terms of the GNU Lesser General Public License
-;; as published by the Free Software Foundation; either version 3, or
-;; (at your option) any later version.
-;;
-;; This program is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-;; Lesser General Public License for more details.
-;;
-;; You should have received a copy of the GNU Lesser General Public
-;; License along with this software; see the file COPYING.LESSER.  If
-;; not, write to the Free Software Foundation, Inc., 51 Franklin
-;; Street, Fifth Floor, Boston, MA 02110-1301 USA
-
-;;; Author: J.R.Hacker
-
-;;; Commentary:
-
-;; Usage: PROGRAM [ARGS]
-;;
-;; PROGRAM does something.
-;;
-;; TODO: Write it!
-
-;;; Code:
-
-(define-module (scripts PROGRAM)
-  :export (PROGRAM))
-
-(define (PROGRAM . args)
-  #t)
-
-(define main PROGRAM)
-
-;;; PROGRAM ends here
diff --git a/module/scripts/list.scm b/module/scripts/list.scm
index c4891b6..6ffc016 100644
--- a/module/scripts/list.scm
+++ b/module/scripts/list.scm
@@ -26,6 +26,7 @@
 ;;; Code:
 
 (define-module (scripts list)
+  #:use-module (ice-9 format)
   #:use-module ((srfi srfi-1) #:select (fold append-map))
   #:export (list-scripts))
 
@@ -50,6 +51,10 @@
   (or-map (lambda (ext)
             (and
              (string-suffix? ext path)
+             ;; We really can't be adding e.g. ChangeLog-2008 to the set
+             ;; of runnable scripts, just because "" is a valid
+             ;; extension, by default.  So hack around that here.
+             (not (string-null? ext))
              (substring path 0
                         (- (string-length path) (string-length ext)))))
           (append %load-compiled-extensions %load-extensions)))
@@ -74,10 +79,30 @@
                   %load-path)
       string<?))))
 
-(define (list-scripts . args)
-  (for-each (lambda (x)
-              ;; would be nice to show a summary.
-              (format #t "~A\n" x))
-            (find-submodules '(scripts))))
+(define (main . args)
+  (display "\
+Usage: guild COMMAND [ARGS]
 
-(define main list-scripts)
+  guild runs command-line scripts provided by GNU Guile and related
+  programs.  See \"Using Guile Tools\" in the Guile manual, for more
+  information.
+
+Commands:
+")
+
+  (for-each
+   (lambda (name)
+     (let* ((modname `(scripts ,(string->symbol name)))
+            (mod (resolve-module modname #:ensure #f))
+            (summary (and mod (and=> (module-variable mod '%summary)
+                                     variable-ref))))
+       (if summary
+           (format #t "  ~A ~32t~a\n" name summary)
+           (format #t "  ~A\n" name))))
+   (find-submodules '(scripts)))
+
+  (display "\
+
+If COMMAND is \"list\" or omitted, display available scripts, otherwise
+COMMAND is run with ARGS.
+"))


hooks/post-receive
-- 
GNU Guile



reply via email to

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