11< html >
22 < head >
33 < meta http-equiv ="Content-Type " content ="text/html; charset=utf-8 " />
4- < title > clojure.tools.cli - tools.cli 0.4.2 -SNAPSHOT API documentation</ title >
4+ < title > clojure.tools.cli - tools.cli 1.0.195 -SNAPSHOT API documentation</ title >
55 < link rel ="icon " href ="static/favicon.png " />
66 < link rel ="shortcut icon " href ="static/favicon.png " />
77 < link rel ="stylesheet " href ="static/clojure.css " type ="text/css " media ="all " />
@@ -25,7 +25,7 @@ <h1><a href="index.html" id="page-header" title="page header title">tools.cli AP
2525 < div id ="leftcolumn "> < div style ="text-align: center; "> </ div >
2626< div class ="menu ">
2727 < div class ="WikiCustomNav WikiElement wiki ">
28- < span class ="toc-header "> < span id ="project-name "> tools.cli</ span > < span id ="version "> 0.4.2 -SNAPSHOT</ span > API</ span > < br />
28+ < span class ="toc-header "> < span id ="project-name "> tools.cli</ span > < span id ="version "> 1.0.195 -SNAPSHOT</ span > API</ span > < br />
2929 < ul >
3030 < li > < a href ="index.html " class ="wiki_link "> Overview</ a > </ li >
3131 < li > < a href ="api-index.html " class ="wiki_link "> API Index</ a > </ li >
@@ -79,7 +79,7 @@ <h1 class="nopad">Table of Contents</h1>
7979</ div >
8080</ div >
8181 < div id ="content-tag "> < h1 id ="overview "> API for < span id ="clojure.tools.cli "> clojure.tools.cli</ span >
82- - < span id ="header-project "> tools.cli</ span > < span id ="header-version "> 0.4.2 -SNAPSHOT</ span > < span id ="header-status-block "> (< span id ="header-status "> in development</ span > )</ span >
82+ - < span id ="header-project "> tools.cli</ span > < span id ="header-version "> 1.0.195 -SNAPSHOT</ span > < span id ="header-status-block "> (< span id ="header-status "> in development</ span > )</ span >
8383 </ h1 >
8484< span id ="author-line "> by < span id ="author-name "> Gareth Jones, Sung Pae, Sean Corfield</ span > < br /> </ span >
8585< br /> Full namespace name: < span id ="long-name "> clojure.tools.cli</ span >
@@ -124,7 +124,7 @@ <h2 id="clojure.tools.cli/cli">cli</h2>
124124 < pre id ="var-specs "> </ pre >
125125
126126
127- < a id ="var-source " href ="https://github.com/clojure/tools.cli/blob/7a5117017062e7f758f509635b9b10b6de501970 /src/main/clojure/clojure/tools/cli.cljc#L184 "> Source</ a >
127+ < a id ="var-source " href ="https://github.com/clojure/tools.cli/blob/3195c7e95fa7527fb0c74085418f44006e724863 /src/main/clojure/clojure/tools/cli.cljc#L197 "> Source</ a >
128128 </ div > < div id ="var-entry ">
129129 < br />
130130 < hr />
@@ -139,7 +139,7 @@ <h2 id="clojure.tools.cli/format-lines">format-lines</h2>
139139 < pre id ="var-specs "> </ pre >
140140 < span class ="var-added "> < span id ="content "> Added in tools.cli version 0.3.0</ span > < br /> </ span >
141141
142- < a id ="var-source " href ="https://github.com/clojure/tools.cli/blob/7a5117017062e7f758f509635b9b10b6de501970 /src/main/clojure/clojure/tools/cli.cljc#L481 "> Source</ a >
142+ < a id ="var-source " href ="https://github.com/clojure/tools.cli/blob/3195c7e95fa7527fb0c74085418f44006e724863 /src/main/clojure/clojure/tools/cli.cljc#L495 "> Source</ a >
143143 </ div > < div id ="var-entry ">
144144 < br />
145145 < hr />
@@ -153,7 +153,7 @@ <h2 id="clojure.tools.cli/get-default-options">get-default-options</h2>
153153 < pre id ="var-specs "> </ pre >
154154 < span class ="var-added "> < span id ="content "> Added in tools.cli version 0.3.2</ span > < br /> </ span >
155155
156- < a id ="var-source " href ="https://github.com/clojure/tools.cli/blob/7a5117017062e7f758f509635b9b10b6de501970 /src/main/clojure/clojure/tools/cli.cljc#L517 "> Source</ a >
156+ < a id ="var-source " href ="https://github.com/clojure/tools.cli/blob/3195c7e95fa7527fb0c74085418f44006e724863 /src/main/clojure/clojure/tools/cli.cljc#L529 "> Source</ a >
157157 </ div > < div id ="var-entry ">
158158 < br />
159159 < hr />
@@ -166,7 +166,7 @@ <h2 id="clojure.tools.cli/make-summary-part">make-summary-part</h2>
166166 < pre id ="var-specs "> </ pre >
167167 < span class ="var-added "> < span id ="content "> Added in tools.cli version 0.3.0</ span > < br /> </ span >
168168
169- < a id ="var-source " href ="https://github.com/clojure/tools.cli/blob/7a5117017062e7f758f509635b9b10b6de501970 /src/main/clojure/clojure/tools/cli.cljc#L457 "> Source</ a >
169+ < a id ="var-source " href ="https://github.com/clojure/tools.cli/blob/3195c7e95fa7527fb0c74085418f44006e724863 /src/main/clojure/clojure/tools/cli.cljc#L471 "> Source</ a >
170170 </ div > < div id ="var-entry ">
171171 < br />
172172 < hr />
@@ -227,6 +227,14 @@ <h2 id="clojure.tools.cli/parse-opts">parse-opts</h2>
227227 option unless set on the command line. Also see :default-fn
228228 (below).
229229
230+ This default is applied before any arguments are parsed so
231+ this is a good way to seed values for :assoc-fn or :update-fn
232+ as well as the simplest way to provide defaults.
233+
234+ If you need to compute a default based on other command line
235+ arguments, or you need to provide a default separate from the
236+ seed for :assoc-fn or :update-fn, see :default-fn below.
237+
230238 :default-desc An optional description of the default value. This should be
231239 used when the string representation of the default value is
232240 too ugly to be printed on the command line, or :default-fn
@@ -238,6 +246,10 @@ <h2 id="clojure.tools.cli/parse-opts">parse-opts</h2>
238246 contain an entry for this option unless set on the command
239247 line. Also see :default (above).
240248
249+ If both :default and :default-fn are provided, if the
250+ argument is not provided on the command-line, :default-fn will
251+ still be called (and can override :default).
252+
241253 :parse-fn A function that receives the required option argument and
242254 returns the option value.
243255
@@ -253,29 +265,35 @@ <h2 id="clojure.tools.cli/parse-opts">parse-opts</h2>
253265 option :id, and the current parsed option value, and returns
254266 a new option map. The default is 'assoc'.
255267
256- For non-idempotent options, use :update-fn below.
268+ For non-idempotent options, where you need to compute a option
269+ value based on the current value and a new value from the
270+ command line. If you only need the the current value, consider
271+ :update-fn (below).
272+
273+ You cannot specify both :assoc-fn and :update-fn for an
274+ option.
257275
258276 :update-fn A function that receives the the current parsed option value,
259277 and returns a new option value, for each option :id present.
260278 The default is 'identity'.
261279
262- You cannot specify both :assoc-fn and :update-fn for an
263- option.
264-
265- This may be used to create non-idempotent options, like
266- setting a verbosity level by specifying an option multiple
267- times. ("-vvv" -> 3)
280+ This may be used to create non-idempotent options where you
281+ only need the current value, like setting a verbosity level by
282+ specifying an option multiple times. ("-vvv" -> 3)
268283
269284 ["-v" "--verbose"
270285 :default 0
271286 :update-fn inc]
272287
273- :default is applied first. If you wish to avoid the :default
288+ :default is applied first. If you wish to omit the :default
274289 option value, use fnil in your :update-fn as follows:
275290
276291 ["-v" "--verbose"
277292 :update-fn (fnil inc 0)]
278293
294+ You cannot specify both :assoc-fn and :update-fn for an
295+ option.
296+
279297 :validate A vector of [validate-fn validate-msg ...]. Multiple pairs
280298 of validation functions and error messages may be provided.
281299
@@ -319,7 +337,7 @@ <h2 id="clojure.tools.cli/parse-opts">parse-opts</h2>
319337 < pre id ="var-specs "> </ pre >
320338 < span class ="var-added "> < span id ="content "> Added in tools.cli version 0.3.0</ span > < br /> </ span >
321339
322- < a id ="var-source " href ="https://github.com/clojure/tools.cli/blob/7a5117017062e7f758f509635b9b10b6de501970 /src/main/clojure/clojure/tools/cli.cljc#L532 "> Source</ a >
340+ < a id ="var-source " href ="https://github.com/clojure/tools.cli/blob/3195c7e95fa7527fb0c74085418f44006e724863 /src/main/clojure/clojure/tools/cli.cljc#L544 "> Source</ a >
323341 </ div > < div id ="var-entry ">
324342 < br />
325343 < hr />
@@ -335,7 +353,7 @@ <h2 id="clojure.tools.cli/summarize">summarize</h2>
335353 < pre id ="var-specs "> </ pre >
336354 < span class ="var-added "> < span id ="content "> Added in tools.cli version 0.3.0</ span > < br /> </ span >
337355
338- < a id ="var-source " href ="https://github.com/clojure/tools.cli/blob/7a5117017062e7f758f509635b9b10b6de501970 /src/main/clojure/clojure/tools/cli.cljc#L500 "> Source</ a >
356+ < a id ="var-source " href ="https://github.com/clojure/tools.cli/blob/3195c7e95fa7527fb0c74085418f44006e724863 /src/main/clojure/clojure/tools/cli.cljc#L512 "> Source</ a >
339357 </ div >
340358</ div >
341359
@@ -346,7 +364,7 @@ <h2 id="clojure.tools.cli/summarize">summarize</h2>
346364 </ div >
347365 </ div >
348366 < div id ="foot ">
349- < div id ="copyright " style ="text-align: center; "> Copyright 2007-2018 by Rich Hickey and the various contributors</ div >
367+ < div id ="copyright " style ="text-align: center; "> Copyright 2007-2019 by Rich Hickey and the various contributors</ div >
350368 </ div >
351369 </ div >
352370 < div id ="DesignedBy "> Logo & site design by < a href ="http://www.tomhickey.com " title ="Visit Tom Hickey's website. "> Tom Hickey</ a > .< br />
0 commit comments