summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeil Jerram <neil@ossau.uklinux.net>2003-08-30 21:22:45 +0000
committerNeil Jerram <neil@ossau.uklinux.net>2003-08-30 21:22:45 +0000
commitdefdc4b4ee80e099701761bb442188f31b287e28 (patch)
tree3d0ceef4200941950d4b5b39603cee3c01fe3a23
parent0f008a157a3718b33de92fd0a8f0568e012929c5 (diff)
downloadguile-defdc4b4ee80e099701761bb442188f31b287e28.tar.gz
Make -s switch optional.
-rw-r--r--THANKS1
-rw-r--r--libguile/ChangeLog6
-rw-r--r--libguile/script.c7
3 files changed, 11 insertions, 3 deletions
diff --git a/THANKS b/THANKS
index fead9fe58..49342212b 100644
--- a/THANKS
+++ b/THANKS
@@ -51,6 +51,7 @@ For fixes or providing information which led to a fix:
Momchil Velikov
Panagiotis Vossos
Neil W. Van Dyke
+ Aaron VanDevender
Michael Talbot-Wilson
Andy Wingo
Keith Wright
diff --git a/libguile/ChangeLog b/libguile/ChangeLog
index 2a8cc3aa0..515ed998b 100644
--- a/libguile/ChangeLog
+++ b/libguile/ChangeLog
@@ -1,3 +1,9 @@
+2003-08-30 Neil Jerram <neil@ossau.uklinux.net>
+
+ * script.c (scm_compile_shell_switches): Make -s switch optional
+ if file to be loaded does not begin with a `-'. (Thanks to Aaron
+ VanDevender for the patch!)
+
2003-08-30 Kevin Ryde <user42@zip.com.au>
* numbers.c (scm_lognot): Rewrite using ~ and mpz_com, for directness
diff --git a/libguile/script.c b/libguile/script.c
index debc7a43b..3e6624594 100644
--- a/libguile/script.c
+++ b/libguile/script.c
@@ -352,11 +352,12 @@ scm_shell_usage (int fatal, char *message)
"Usage: %s OPTION ...\n"
"Evaluate Scheme code, interactively or from a script.\n"
"\n"
- " -s SCRIPT load Scheme source code from FILE, and exit\n"
+ " [-s] FILE load Scheme source code from FILE, and exit\n"
" -c EXPR evalute Scheme expression EXPR, and exit\n"
" -- stop scanning arguments; run interactively\n"
"The above switches stop argument processing, and pass all\n"
"remaining arguments as the value of (command-line).\n"
+ "If FILE begins with `-' the -s switch is mandatory.\n"
"\n"
" -l FILE load Scheme source code from FILE\n"
" -e FUNCTION after reading script, apply FUNCTION to\n"
@@ -436,9 +437,9 @@ scm_compile_shell_switches (int argc, char **argv)
for (i = 1; i < argc; i++)
{
- if (! strcmp (argv[i], "-s")) /* load script */
+ if ((! strcmp (argv[i], "-s")) || (argv[i][0] != '-')) /* load script */
{
- if (++i >= argc)
+ if ((argv[i][0] == '-') && (++i >= argc))
scm_shell_usage (1, "missing argument to `-s' switch");
/* If we specified the -ds option, do_script points to the