]> gitweb.factorcode.org Git - factor.git/commitdiff
command-line: need to check rest of args.
authorJohn Benediktsson <mrjbq7@gmail.com>
Tue, 14 Aug 2012 03:57:39 +0000 (20:57 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Tue, 14 Aug 2012 03:57:39 +0000 (20:57 -0700)
basis/command-line/command-line.factor

index 0b24d2760317ea57a3e19b2107bcf5a41ce34c3e..71f87d8658d0c0c628370a869a095f290f757138 100644 (file)
@@ -62,12 +62,15 @@ SYMBOL: command-line
         [ source-file main>> [ execute( -- ) ] when* ] bi
     ] with-variable ;
 
+: run-script? ( rest first -- rest first ? )
+    over empty? not "run" get-global and ;
+
 : parse-command-line ( args -- )
     [ command-line off script off ] [
         unclip "-" ?head
         [ param parse-command-line ]
         [
-            "run" get-global [ prefix f ] when
+            run-script? [ prefix f ] when
             script set command-line set
         ] if
     ] if-empty ;