*main-cli-fn*

varsince v0.0-927Edit

When compiled for a command-line target, whatever function *main-cli-fn* is set to will be called with the command-line argv as arguments.


Details:

Currently only available for Node (compiler option :target :nodejs)


Examples:

(defn -main [& args]
  (println "You passed the following command line args:")
  (println args))

(set! *main-cli-fn* -main)

Source docstring:
When compiled for a command-line target, whatever function
*main-cli-fn* is set to will be called with the command-line
argv as arguments
Source code @ clojurescript:src/main/cljs/cljs/core.cljs
(def
  ^{:doc "When compiled for a command-line target, whatever function
  *main-cli-fn* is set to will be called with the command-line
  argv as arguments"}
  *main-cli-fn* nil)