1 ! Copyright (C) 2011 Joe Groff.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: command-line eval io io.pathnames kernel namespaces
5 IN: command-line.startup
9 Usage: """ write vm file-name write """ [Factor arguments] [script] [script arguments]
12 -help print this message and exit
13 -i=<image> load Factor image file <image> (default """ write vm file-name write """.image)
14 -run=<vocab> run the MAIN: entry point of <vocab>
15 -e=<code> evaluate <code>
16 -no-user-init suppress loading of .factor-rc
20 from within Factor for more information.
24 : command-line-startup ( -- )
25 (command-line) parse-command-line
26 "help" get "-help" get or "h" get or [ cli-usage ] [
30 "e" get script get or [
31 "e" get [ eval( -- ) ] when*
32 script get [ run-script ] when*
38 output-stream get [ stream-flush ] when*