Skip to content

Instantly share code, notes, and snippets.

@bobbicodes
Created November 14, 2018 17:08
Show Gist options
  • Save bobbicodes/408afcd388e5c80e00970b773df42772 to your computer and use it in GitHub Desktop.
Save bobbicodes/408afcd388e5c80e00970b773df42772 to your computer and use it in GitHub Desktop.
$ clj -m cljs.main --help
Usage: java -cp cljs.jar cljs.main [init-opt*] [main-opt] [arg*]
With no options or args, runs an interactive Read-Eval-Print Loop
init options:
-co, --compile-opts edn Options to configure the build, can be an EDN
string or system-dependent path-separated list of
EDN files / classpath resources. Options will be
merged left to right.
-d, --output-dir path Set the output directory to use. If supplied,
cljsc_opts.edn in that directory will be used to
set ClojureScript compiler options
-re, --repl-env env The REPL environment to use. Built-in supported
values: nashorn, graaljs, node, browser, rhino.
Defaults to browser
-ro, --repl-opts edn Options to configure the repl-env, can be an EDN
string or system-dependent path-separated list of
EDN files / classpath resources. Options will be
merged left to right.
-t, --target name The JavaScript target. Configures environment
bootstrap and defaults to browser. Supported
values: node or nodejs, nashorn, graaljs,
webworker, none
init options only for --main and --repl:
-e, --eval string Evaluate expressions in string; print non-nil
values
-i, --init path Load a file or resource
-v, --verbose bool If true, will enable ClojureScript verbose logging
init options only for --compile:
-O, --optimizations level Set optimization level, only effective with --
compile main option. Valid values are: none,
whitespace, simple, advanced
-o, --output-to file Set the output compiled file
-w, --watch paths Continuously build, only effective with the --
compile main option. Specifies a system-dependent
path-separated list of directories to watch.
browser REPL options:
-H, --host address Address to bind
-p, --port number Port to bind
main options:
- Run a script from standard input
-c, --compile [ns] Run a compile. If optional namespace specified,
use as the main entry point. If --repl follows,
will launch a REPL after the compile completes.
If --server follows, will start a web server that
serves the current directory after the compile
completes.
-h, --help, -? Print this help message and exit
-m, --main ns Call the -main function from a namespace with args
-r, --repl Run a repl
-s, --serve host:port Start a simple web server to serve the current
directory
path Run a script from a file or resource
For --main and --repl:
- Enters the cljs.user namespace
- Binds *command-line-args* to a seq of strings containing command line
args that appear after any main option
- Runs all init options in order
- Calls a -main function or runs a repl or script if requested
The init options may be repeated and mixed freely, but must appear before
any main option.
In the case of --compile you may supply --repl or --serve options afterwards.
Paths may be absolute or relative in the filesystem or relative to
classpath. Classpath-relative paths have prefix of @ or @/
rlwrap: error: read error on master pty: Input/output error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment