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
8 "Usage: " write vm-path file-name write " [Factor arguments] [script] [script arguments]
11 -help print this message and exit
12 -i=<image> load Factor image file <image> (default " write vm-path file-stem write ".image)
13 -run=<vocab> run the MAIN: entry point of <vocab>
14 -run=listener run terminal listener
15 -run=ui.tools run Factor development UI
16 -e=<code> evaluate <code>
17 -no-user-init suppress loading of .factor-rc
18 -datastack=<int> datastack size in KB
19 -retainstack=<int> retainstack size in KB
20 -callstack=<int> callstack size in KB
21 -callbacks=<int> callback heap size in KB
22 -young=<int> young gc generation 0 size in MB
23 -aging=<int> aging gc generation 1 size in MB
24 -tenured=<int> tenured gc generation 2 size in MB
25 -codeheap=<int> codeheap size in MB
26 -pic=<int> max pic size
27 -fep enter fep mode immediately
28 -nosignals turn off OS signal handling
29 -console open console if possible
30 -roots=<paths> a list of \"" write os windows? ";" ":" ? write "\"-delimited extra vocab roots
34 from within Factor for more information.
39 "help" get "-help" get or "h" get or
40 os windows? [ script get "/?" = ] [ f ] if or ;
42 : command-line-startup ( -- )
43 (command-line) parse-command-line
47 "e" get script get or [
48 "e" get [ eval( -- ) ] when*
49 script get [ run-script ] when*
55 output-stream get [ stream-flush ] when*