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
4 sequences system vocabs.loader ;
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-stem write """.image)
14 -run=<vocab> run the MAIN: entry point of <vocab>
15 -run=listener run terminal listener
16 -run=ui.tools run Factor development UI
17 -e=<code> evaluate <code>
18 -no-user-init suppress loading of .factor-rc
22 from within Factor for more information.
27 "help" get "-help" get or "h" get or
28 os windows? [ script get "/?" = ] [ f ] if or ;
30 : command-line-startup ( -- )
31 (command-line) parse-command-line
35 "e" get script get or [
36 "e" get [ eval( -- ) ] when*
37 script get [ run-script ] when*
43 output-stream get [ stream-flush ] when*