@@ -434,7 +434,8 @@ present"
434
434
435
435
(defn- main-opt
436
436
" Call the -main function from a namespace with string arguments from
437
- the command line."
437
+ the command line. Can be customized with ::cljs.cli/main fn entry in
438
+ the map returned by cljs.repl/IReplEnvOptions."
438
439
[repl-env [_ ns & args] cfg]
439
440
((::main (repl/repl-options (repl-env )) default-main )
440
441
repl-env (merge cfg {:main ns :args args})))
@@ -450,6 +451,9 @@ present"
450
451
(println (help-str repl-env)))
451
452
452
453
(defn- script-opt
454
+ " If no main option was given (compile, repl, main), handles running in
455
+ 'script' mode. Can be customized with ::cljs.cli/main fn entry in
456
+ the map returned by cljs.repl/IReplEnvOptions."
453
457
[repl-env [path & args] cfg]
454
458
((::main (repl/repl-options (repl-env )) default-main )
455
459
repl-env (merge cfg {:script path :args args})))
@@ -540,6 +544,8 @@ present"
540
544
(serve-opt repl-env args cfg)))))
541
545
542
546
(defn- compile-opt
547
+ " Handle the compile flag. Custom compilation is possible by providing
548
+ :cljs.cli/compile fn in the map returned by cljs.repl/IReplEnvOptions."
543
549
[repl-env [_ ns & args] cfg]
544
550
((::compile (repl/-repl-options (repl-env )) default-compile )
545
551
repl-env (merge cfg {:args args :ns ns })))
0 commit comments