! Copyright (C) 2011 Joe Groff. ! See http://factorcode.org/license.txt for BSD license. USING: command-line eval io io.pathnames kernel namespaces sequences system vocabs.loader ; IN: command-line.startup : cli-usage ( -- ) "Usage: " write vm-path file-name write " [Factor arguments] [script] [script arguments] Common arguments: -help print this message and exit -i= load Factor image file (default " write vm-path file-stem write ".image) -run= run the MAIN: entry point of -run=listener run terminal listener -run=ui.tools run Factor development UI -e= evaluate -no-user-init suppress loading of .factor-rc -datastack= datastack size in kb -retainstack= retainstack size in kb -callstack= callstack size in kb -callbacks= callback heap size in kb -young= young gc generation 0 size in MB -aging= aging gc generation 1 size in MB -tenured= tenured gc generation 2 size in MB -codeheap= codeheap size in MB -pic= max pic size -fep enter fep mode immediately -nosignals turn off OS signal handling -console open console if possible Enter \"command-line\" help from within Factor for more information. " write ; : help? ( -- ? ) "help" get "-help" get or "h" get or os windows? [ script get "/?" = ] [ f ] if or ; : command-line-startup ( -- ) (command-line) parse-command-line help? [ cli-usage ] [ load-vocab-roots run-user-init "e" get script get or [ "e" get [ eval( -- ) ] when* script get [ run-script ] when* ] [ "run" get run ] if ] if output-stream get [ stream-flush ] when* 0 exit ;