<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -18,21 +18,30 @@ case &quot;$(mzscheme --version)&quot; in
     *) plt4=no;;
 esac
 
+if (( $# ))
+then repl='#f'
+else
+    # It seems like there ought to be a program for determining whether standard
+    # input is a tty, but I can't find one; so we use mzscheme instead.
+    if [ $plt4 = yes ]
+    then repl=$(mzscheme -e '(terminal-port? (current-input-port))')
+    else repl=$(mzscheme -mve '(display (terminal-port? (current-input-port)))')
+    fi
+fi
+
 opts=&quot;--no-init-file&quot;
 
-# It seems like there ought to be a program for determining whether standard
-# input is a tty, but I can't find one; so we use mzscheme instead.
 if [ $plt4 = yes ]; then
-    case $(mzscheme -e '(terminal-port? (current-input-port))') in
-        '#t') # AFAICT, there is no equivalent of --mute-banner for mzscheme v4
-              opts+=&quot; --repl --load&quot;;;
-        *) opts+=&quot; --script&quot;;;
-    esac
+    if [ $repl = '#t' ]
+    then # AFAICT, there is no equivalent of --mute-banner for mzscheme v4
+        opts+=' --repl --load'
+    else opts+=' --script'
+    fi
 else
-    case $(mzscheme -mve '(display (terminal-port? (current-input-port)))') in
-        '#t') opts+=&quot; --mute-banner --load&quot;;;
-        *) opts+=&quot; --script&quot;;;
-    esac
+    if [ $repl = '#t' ]
+    then opts+=&quot; --mute-banner --load&quot;
+    else opts+=&quot; --script&quot;
+    fi
 fi
 
 $rl mzscheme $opts $arc_dir/as.scm $@</diff>
      <filename>arc.sh</filename>
    </modified>
    <modified>
      <diff>@@ -13,5 +13,9 @@
   (aload &quot;arc.arc&quot;)
   (aload &quot;libs.arc&quot;))
 
-(tl)
+(let ((args (vector-&gt;list (current-command-line-arguments))))
+  (if (null? args)
+    (tl)
+    ; command-line arguments are script filenames to execute
+    (for-each (lambda (f) (aload f)) args)))
 </diff>
      <filename>as.scm</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>e518e3b323a63bc8bff13df75ec5b48eb06778a1</id>
    </parent>
  </parents>
  <author>
    <name>Michael Arntzenius</name>
    <email>daekharel@gmail.com</email>
  </author>
  <url>http://github.com/nex3/arc/commit/5ac5d567bce08004c0dce6fc4cf4d63dbdc26535</url>
  <id>5ac5d567bce08004c0dce6fc4cf4d63dbdc26535</id>
  <committed-date>2009-08-10T22:05:14-07:00</committed-date>
  <authored-date>2009-08-10T22:05:14-07:00</authored-date>
  <message>Add support for running scripts via command-line arguments

If there are any command-line arguments to as.scm, they will be interpreted as
script filenames to be executed, and the REPL will not be run.

arc.sh has been updated to understand this as well, and will pass on arguments
to mzscheme sans REPL if they are present.</message>
  <tree>a3faa773069337e532fe67f61217914f929cec2e</tree>
  <committer>
    <name>Michael Arntzenius</name>
    <email>daekharel@gmail.com</email>
  </committer>
</commit>
