command-line: need to check rest of args.

db4
John Benediktsson 2012-08-13 20:57:39 -07:00
parent 2620c64c21
commit 2109af55ad
1 changed files with 4 additions and 1 deletions

View File

@ -62,12 +62,15 @@ SYMBOL: command-line
[ source-file main>> [ execute( -- ) ] when* ] bi [ source-file main>> [ execute( -- ) ] when* ] bi
] with-variable ; ] with-variable ;
: run-script? ( rest first -- rest first ? )
over empty? not "run" get-global and ;
: parse-command-line ( args -- ) : parse-command-line ( args -- )
[ command-line off script off ] [ [ command-line off script off ] [
unclip "-" ?head unclip "-" ?head
[ param parse-command-line ] [ param parse-command-line ]
[ [
"run" get-global [ prefix f ] when run-script? [ prefix f ] when
script set command-line set script set command-line set
] if ] if
] if-empty ; ] if-empty ;