Skip to content

Commit 5b291ca

Browse files
committed
* document supported customization
1 parent 786bc0f commit 5b291ca

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/main/clojure/cljs/cli.clj

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,8 @@ present"
434434

435435
(defn- main-opt
436436
"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."
438439
[repl-env [_ ns & args] cfg]
439440
((::main (repl/repl-options (repl-env)) default-main)
440441
repl-env (merge cfg {:main ns :args args})))
@@ -450,6 +451,9 @@ present"
450451
(println (help-str repl-env)))
451452

452453
(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."
453457
[repl-env [path & args] cfg]
454458
((::main (repl/repl-options (repl-env)) default-main)
455459
repl-env (merge cfg {:script path :args args})))
@@ -540,6 +544,8 @@ present"
540544
(serve-opt repl-env args cfg)))))
541545

542546
(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."
543549
[repl-env [_ ns & args] cfg]
544550
((::compile (repl/-repl-options (repl-env)) default-compile)
545551
repl-env (merge cfg {:args args :ns ns})))

0 commit comments

Comments
 (0)