3 # Copyright (C) 2001 Free Software Foundation, Inc.
5 # This program is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU General Public License as
7 # published by the Free Software Foundation; either version 2, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 # General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this software; see the file COPYING. If not, write to
17 # the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
18 # Boston, MA 02111-1307 USA
20 # Usage: guile-tools --version
22 # guile-tools [OPTION] PROGRAM [ARGS]
24 # PROGRAM is run w/ ARGS. To see a list of available programs, use
25 # "guile-tools --help" to find the default scripts directory and then
26 # do a "ls" on that directory. Or just read the source 14 lines below.
28 # Options (only one of which may be used at a time):
29 # --scriptsdir DIR -- Look in DIR for scripts
30 # --guileversion VERS -- Look in $pkgdatadir/VERS/scripts for scripts
33 # - handle pre-install invocation
34 # - "full" option processing (but see comment below)
36 # Author: Thien-Thi Nguyen
39 pkgdatadir
="@datadir@/@PACKAGE@"
40 guileversion
="@GUILE_VERSION@"
41 default_scriptsdir
=$pkgdatadir/$guileversion/scripts
43 # pre-install invocation frob
45 if [ -d "$mydir/scripts" -a -f "$mydir/scripts/Makefile.am" ] ; then
46 default_scriptsdir
=`(cd $mydir/scripts ; pwd)`
51 echo "$0 [--scriptsdir DIR | --guileversion VERSION] PROGRAM [ARGS]"
52 echo default scriptsdir
: $default_scriptsdir
55 # option processing -- basically, you can override either the script dir
56 # completely, or just the guile version. we choose implementation simplicity
59 if [ x
"$1" = x--version
] ; then
64 if [ x
"$1" = x--help
-o x
"$1" = x
] ; then
69 if [ x
"$1" = x--scriptsdir
] ; then
73 elif [ x
"$1" = x--guileversion
] ; then
74 user_scriptsdir
=$pkgdatadir/$2/scripts
79 scriptsdir
=${user_scriptsdir-$default_scriptsdir}
81 if [ ! -d $scriptsdir ] ; then
82 echo $0: no such directory
: $scriptsdir
86 if [ x
"$1" = x
] ; then
91 program
=$scriptsdir/$1
94 if [ -x $program ] ; then
97 echo $0: no such program
: $program
101 # guile-tools ends here