]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/command-line/startup/startup.factor
core: Add auto-use to syntax and add -ea parameter to factor command line.
[factor.git] / basis / command-line / startup / startup.factor
index d046fe281dfc0bfc14ce3d613a680d6643fe79d8..27c7071286b56e2b302c3981c277f86375b242c5 100644 (file)
@@ -1,7 +1,7 @@
 ! Copyright (C) 2011 Joe Groff.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: combinators command-line eval io io.pathnames kernel
-layouts math math.parser namespaces system vocabs.loader ;
+layouts math math.parser namespaces parser system vocabs.loader ;
 IN: command-line.startup
 
 : help? ( -- ? )
@@ -19,6 +19,7 @@ Options:
         -run=listener   run terminal listener
         -run=ui.tools   run Factor development UI
     -e=<code>           evaluate <code>
+    -ea=<code>          evaluate <code> with auto-use
     -no-user-init       suppress loading of .factor-rc
     -datastack=<int>    datastack size in KiB [" write cell 32 * number>string write "]
     -retainstack=<int>  retainstack size in KiB [" write cell 32 * number>string write "]
@@ -49,8 +50,9 @@ from within Factor for more information.
         [
             load-vocab-roots
             run-user-init
-            "e" get script get or [
+            "e" get "ea" get script get or or [
                 "e" get [ eval( -- ) ] when*
+                "ea" get [ t auto-use? [ eval( -- ) ] with-variable ] when*
                 script get [ run-script ] when*
             ] [
                 "run" get run