@@ -67,18 +67,22 @@ fun main(args):
6767
6868 cases ( C . ParsedArguments ) params-parsed block:
6969 | success( r, rest) =>
70- check-mode = not ( r. has-key( "no-check-mode" ) or r. has-key( "library" ))
71- allow-shadowed = r. has-key( "allow-shadow" )
7270 libs =
7371 if r. has-key( "library" ) : CS . minimal-imports
7472 else : CS . standard-imports end
7573 module-dir = r. get-value( "module-load-dir" )
76- check-all = r. has-key( "check-all" )
77- type-check = r. has-key( "type-check" )
78- tail-calls = not ( r. has-key( "improper-tail-calls" ))
79- compiled-dir = r. get-value( "compiled-dir" )
80- standalone-file = r. get-value( "standalone-file" )
81- display-progress = not ( r. has-key( "no-display-progress" ))
74+ user-compile-options = CS . default-compile-options. {
75+ check-mode: not ( r. has-key( "no-check-mode" ) or r. has-key( "library" )) ,
76+ allow-shadowed: r. has-key( "allow-shadow" ) ,
77+ check-all: r. has-key( "check-all" ) ,
78+ type-check: r. has-key( "type-check" ) ,
79+ tail-calls: not ( r. has-key( "improper-tail-calls" )) ,
80+ compiled-dir: r. get-value( "compiled-dir" ) ,
81+ standalone-file: r. get-value( "standalone-file" ) ,
82+ display-progress: not ( r. has-key( "no-display-progress" )) ,
83+ collect-all: false ,
84+ ignore-unbound: false
85+ }
8286 when r. has-key( "builtin-js-dir" ) :
8387 B . set-builtin-js-dirs( r. get-value( "builtin-js-dir" ))
8488 end
@@ -101,17 +105,8 @@ fun main(args):
101105 r. get-value( "build-runnable" ) ,
102106 r. get-value( "require-config" ) ,
103107 outfile,
104- CS . default-compile-options. {
105- standalone-file: standalone-file,
106- check-mode : check-mode,
107- type-check : type-check,
108- allow-shadowed : allow-shadowed,
109- collect-all: false ,
110- ignore-unbound: false ,
111- proper-tail-calls: tail-calls,
112- compile-module: true ,
113- compiled-cache: compiled-dir,
114- display-progress: display-progress
108+ user-compile-options. {
109+ compile-module: true
115110 } )
116111 else if r. has-key( "serve" ) :
117112 port = r. get-value( "port" )
@@ -134,15 +129,8 @@ fun main(args):
134129 |#
135130 else if r. has-key( "build" ) :
136131 result = CLI . compile( r. get-value( "build" ) ,
137- CS . default-compile-options. {
138- check-mode : check-mode,
139- type-check : type-check,
140- allow-shadowed : allow-shadowed,
141- collect-all: false ,
142- ignore-unbound: false ,
143- proper-tail-calls: tail-calls,
144- compile-module: false ,
145- display-progress: display-progress
132+ user-compile-options. {
133+ compile-module: false
146134 } )
147135 failures = filter( CS . is-err, result. loadables)
148136 when is-link( failures) :
@@ -155,12 +143,14 @@ fun main(args):
155143 end
156144 end
157145 else if r. has-key( "run" ) :
158- CLI . run( r. get-value( "run" ) , CS . default-compile-options. {
159- standalone-file: standalone-file,
160- compile-module: true ,
161- display-progress: display-progress,
162- check-all: check-all
163- } )
146+ block:
147+ result = CLI . run( r. get-value( "run" ) , user-compile-options. {
148+ compile-module: false
149+ } )
150+ print( result. message)
151+ print( "\n" )
152+ result. exit-code # TODO: exit process with this code
153+ end
164154 else :
165155 print( C . usage-info( options). join-str( "\n" ))
166156 raise( "Unknown command line options" )
0 commit comments