Skip to content

Commit a92a7cb

Browse files
committed
option descriptions
1 parent d47a05c commit a92a7cb

File tree

1 file changed

+109
-20
lines changed

1 file changed

+109
-20
lines changed

content/reference/clojure_cli.adoc

Lines changed: 109 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -42,39 +42,39 @@ Each execution of the Clojure CLI runs a Clojure program by determining all path
4242
`clojure [clj-opts] -M[aliases] [init-opts] [main-opts] [args]`
4343

4444
[[options]]
45-
=== Option index:
45+
=== Option index
4646

4747
[subs=+macros]
4848
----
4949
exec-opts:
50-
<<clojure_cli#opt_a,-Aaliases>> Use aliases, particularly for repl execution
50+
<<clojure_cli#opt_a,-Aaliases>> Apply aliases
5151
<<clojure_cli#opt_x,-X[aliases]>> Invoke function, using aliases
5252
<<clojure_cli#opt_t,-Ttoolname>> Invoke tool by local name
53-
<<clojure_cli#opt_t,-T[aliases]>> Invoke tool by concatenated aliases (ala -X)
53+
<<clojure_cli#opt_t,-T[aliases]>> Invoke tool using aliases
5454
<<clojure_cli#opt_m,-M[aliases]>> Invoke clojure.main, using aliases
5555
<<clojure_cli#opt_p,-P>> Prepare deps but don't exec
5656
5757
clj-opts:
58-
<<clojure_cli#opt_j,-Jopt>> Pass opt through in java_opts, ex: -J-Xmx512m
58+
<<clojure_cli#opt_j,-Jopt>> Pass JVM option
5959
<<clojure_cli#opt_sdeps,-Sdeps EDN>> Extra deps.edn data
6060
<<clojure_cli#opt_srepro,-Srepro>> Ignore user deps.edn file
61-
<<clojure_cli#opt_spath,-Spath>> Compute classpath, echo to stdout
61+
<<clojure_cli#opt_spath,-Spath>> Compute and echo classpath
6262
<<clojure_cli#opt_stree,-Stree>> Print dependency tree
63-
<<clojure_cli#opt_scp,-Scp CP>> Use this classpath instead of computing
64-
<<clojure_cli#opt_sforce,-Sforce>> Force recomputation of the classpath
65-
<<clojure_cli#opt_sverbose,-Sverbose>> Print important path info to console
66-
<<clojure_cli#opt_sdescribe,-Sdescribe>> Print environment and command parsing info as data
63+
<<clojure_cli#opt_scp,-Scp CP>> Use this classpath, ignore deps.edn
64+
<<clojure_cli#opt_sforce,-Sforce>> Force classpath computation
65+
<<clojure_cli#opt_sverbose,-Sverbose>> Print path info
66+
<<clojure_cli#opt_sdescribe,-Sdescribe>> Print env and command parsing info
6767
<<clojure_cli#opt_sthreads,-Sthreads>> Set specific number of download threads
68-
<<clojure_cli#opt_strace,-Strace>> Write a trace.edn file that traces deps expansion
69-
<<clojure_cli#opt_sversion,--version>> Print the version to stdout and exit
70-
<<clojure_cli#opt_sversion,-version>> Print the version to stderr and exit
71-
<<clojure_cli#opt_help,--help -h -?>> Print this help message and exit
68+
<<clojure_cli#opt_strace,-Strace>> Write dep expansion trace.edn
69+
<<clojure_cli#opt_version,--version>> Print version to stdout and exit
70+
<<clojure_cli#opt_version,-version>> Print version to stderr and exit
71+
<<clojure_cli#opt_help,--help -h -?>> Print this help message
7272
7373
Programs provided by :deps alias:
74-
<<clojure_cli#deps_list,-X:deps list>> List transitive deps + licenses
74+
<<clojure_cli#deps_list,-X:deps list>> Print deps list+licenses
7575
<<clojure_cli#deps_tree,-X:deps tree>> Print deps tree
76-
<<clojure_cli#deps_find_versions,-X:deps find-versions>> Find available versions of library
77-
<<clojure_cli#deps_prep,-X:deps prep>> Prepare all unprepped libs in dep tree
76+
<<clojure_cli#deps_find_versions,-X:deps find-versions>> Find available lib versions
77+
<<clojure_cli#deps_prep,-X:deps prep>> Prepare all unprepped libs in deps
7878
<<clojure_cli#deps_mvn_pom,-X:deps mvn-pom>> Generate pom.xml for deps.edn
7979
<<clojure_cli#deps_mvn_install,-X:deps mvn-install>> Install maven jar to local repo
8080
----
@@ -118,17 +118,13 @@ Function execution ultimately needs the following pieces of information:
118118
* Qualified function to execute
119119
* Map of key to value
120120

121-
122-
123121
`-X` <<clojure_cli#aliases,aliases>> can contain the following arg map keys:
124122

125123
* `:exec-fn` - a function symbol to use when none is supplied on the command line
126124
* `:exec-args` - a map of key to value to include when `exec-fn` is executed, may be superseded by keyword args on the command line (so these act as defaults)
127125
* `:ns-default` - default namespace symbol to use when interpreting the exec-fn
128126
* `:ns-aliases` - map of alias symbol to namespace symbol to use when interpreting the exec-fn
129127

130-
131-
132128
[source,clojure]
133129
----
134130
;; deps.edn
@@ -216,6 +212,99 @@ __main-opts:__
216212

217213
See the <<repl_and_main#,clojure.main>> documentation for more details on main options.
218214

215+
[[options]]
216+
== Options
217+
218+
[[opt_a]]
219+
**-Aaliases**
220+
221+
`-A`
222+
223+
[[opt_x]]
224+
**-X[aliases]**
225+
226+
[[opt_t]]
227+
**-Ttoolname, -T[aliases]**
228+
229+
[[opt_m]]
230+
**-M[aliases]**
231+
232+
[[opt_p]]
233+
**-P**
234+
235+
Use `-P` before any of the other exec-opts (`-A`, `-X`, `-M`, `-T`) to do a full deps expansion, download deps, and cache the classpath, but not actually execute the function, tool, main, etc.
236+
237+
[[opt_j]]
238+
**-Jopt**
239+
240+
Use `-J` to prefix any JVM option that should be provided to your program (the `-J` will be stripped). For example, `-J-Xmx1g` or `-J-XX:+HeapDumpOnOutOfMemoryError`.
241+
242+
[[opt_sdeps]]
243+
**-Sdeps deps**
244+
245+
Use `-Sdeps` to supply an additional deps.edn source on the command line. This is used as the last <<clojure_cli#deps_sources,deps source>> in the merge. The deps data will need to be appropriately <<clojure_cli#quoting,quoted>> for the command line.
246+
247+
[[opt_srepro]]
248+
**-Srepro**
249+
250+
Use `-Srepro` to omit the user deps.edn from the deps sources. This omits any user-specific configuration to ensure the command is repeatable for others.
251+
252+
Clojure <<clojure_cli#deps_sources,deps sources
253+
254+
[[opt_spath]]
255+
**-Spath**
256+
257+
Use `-Spath` to compute and print the classpath.
258+
259+
[[opt_stree]]
260+
**-Stree**
261+
262+
Use `-Stree` to compute and print the dependency tree. See the <<dep_expansion#_tree_printing,dependency expansion>> page for more information on the tree printing output.
263+
264+
[[opt_scp]]
265+
**-Scp CP**
266+
267+
When this option is used, the classpath is not computed and the provided classpath is used instead. This is mostly useful in testing or debugging. In general, you should let the Clojure CLI compute (and cache) your classpath based on the deps.edn settings.
268+
269+
[[opt_sforce]]
270+
**-Sforce**
271+
272+
This flag marks the existing cached classpath (if any) to be marked as stale. The classpath will be recomputed and cache.
273+
274+
[[opt_sverbose]]
275+
**-Sverbose**
276+
277+
Print environment and path information found and used by the Clojure CLI, mostly useful for debugging the location of various config and cache directories.
278+
279+
This flag does not alter any other execution that may be specified on the command line, so it can be used to debug the location of the cache files for a particular command.
280+
281+
[[opt_sdescribe]]
282+
**-Sdescribe**
283+
284+
Print configuration settings as edn data and exit. This overlaps in functionality with `-Sverbose` but may be useful for programmatic use.
285+
286+
[[opt_sthreads]]
287+
**-Sthreads N**
288+
289+
By default, dep expansion will happen using a thread pool sized based on the processor count. Use this setting to change the number of threads used during expansion. Setting to 1 will do expansion serially with a single thread.
290+
291+
[[opt_strace]]
292+
**-Strace**
293+
294+
The dependency tree printed by <<clojure_cli#opt_stree#`-Stree`>> or <<clojure_cli#deps_tree,`-X:deps tree`>> often contains sufficient information to debug why a particular lib or lib version was selected. However, if you need more information, this flag prints significantly larger information to a trace.edn file that can be used when filing an issue on tools.deps at https://ask.clojure.org[Ask Clojure].
295+
296+
[[opt_version]]
297+
**--version, -version**
298+
299+
Prints the Clojure CLI version to either stdout (`--version`) or stderr (`-version`). Note that while the Clojure CLI version determines the default Clojure version used in execution, any version of the CLI can use any version of Clojure, and the Clojure version can be set in <<deps_edn#,deps.edn>> files to change that version.
300+
301+
See the <<xref/../../../releases/tools#,tools release>> page for more version and changelog information.
302+
303+
[[opt_help]]
304+
**--help, -h, -?**
305+
306+
Print help to console. Also see `man clojure`.
307+
219308
[[aliases]]
220309
== Aliases
221310

0 commit comments

Comments
 (0)