Skip to content

Commit a251f2c

Browse files
committed
Autodoc commit for master/3c895609
1 parent dea69ee commit a251f2c

3 files changed

Lines changed: 54 additions & 20 deletions

File tree

api-index.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,8 @@ <h2 id="F"><span id="section-head">F</span></h2>
101101
</div><div id="index-body">
102102
<h2 id="G"><span id="section-head">G</span></h2>
103103
<pre>
104-
104+
<span id="section-content"> <a href="index.html#clojure.tools.cli/get-default-options">get-default-options</a><span id="line-content"> function clojure.tools.cli Extract the map of default options from a sequence...
105+
</span></span>
105106
</pre>
106107
</div><div id="index-body">
107108
<h2 id="H"><span id="section-head">H</span></h2>

index-0.3.2.clj

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,68 @@
11
{:namespaces
22
({:source-url
3-
"https://github.com/clojure/tools.cli/blob/ee7f1cc054689070a768c89d22713a02e3e34f6a/src/main/clojure/clojure/tools/cli.clj",
3+
"https://github.com/clojure/tools.cli/blob/3c8956096444d5d6f81d46401a00ac2e2e216aa0/src/main/clojure/clojure/tools/cli.clj",
44
:wiki-url
55
"http://clojure.github.com/tools.cli/clojure.tools.cli-api.html",
66
:name "clojure.tools.cli",
77
:author "Gareth Jones, Sung Pae",
8-
:doc nil}),
8+
:doc "Tools for working with command line arguments."}),
99
:vars
1010
({:arglists ([args & specs]),
1111
:name "cli",
1212
:namespace "clojure.tools.cli",
1313
:source-url
14-
"https://github.com/clojure/tools.cli/blob/ee7f1cc054689070a768c89d22713a02e3e34f6a/src/main/clojure/clojure/tools/cli.clj#L179",
14+
"https://github.com/clojure/tools.cli/blob/3c8956096444d5d6f81d46401a00ac2e2e216aa0/src/main/clojure/clojure/tools/cli.clj#L180",
1515
:raw-source-url
16-
"https://github.com/clojure/tools.cli/raw/ee7f1cc054689070a768c89d22713a02e3e34f6a/src/main/clojure/clojure/tools/cli.clj",
16+
"https://github.com/clojure/tools.cli/raw/3c8956096444d5d6f81d46401a00ac2e2e216aa0/src/main/clojure/clojure/tools/cli.clj",
1717
:wiki-url
1818
"http://clojure.github.com/tools.cli//clojure.tools.cli-api.html#clojure.tools.cli/cli",
1919
:doc
2020
"THIS IS A LEGACY FUNCTION and may be deprecated in the future. Please use\nclojure.tools.cli/parse-opts in new applications.\n\nParse the provided args using the given specs. Specs are vectors\ndescribing a command line argument. For example:\n\n[\"-p\" \"--port\" \"Port to listen on\" :default 3000 :parse-fn #(Integer/parseInt %)]\n\nFirst provide the switches (from least to most specific), then a doc\nstring, and pairs of options.\n\nValid options are :default, :parse-fn, and :flag. See\nhttps://github.com/clojure/tools.cli/wiki/Documentation-for-0.2.4 for more\ndetailed examples.\n\nReturns a vector containing a map of the parsed arguments, a vector\nof extra arguments that did not match known switches, and a\ndocumentation banner to provide usage instructions.",
2121
:var-type "function",
22-
:line 179,
22+
:line 180,
23+
:file "src/main/clojure/clojure/tools/cli.clj"}
24+
{:arglists ([option-specs]),
25+
:name "get-default-options",
26+
:namespace "clojure.tools.cli",
27+
:source-url
28+
"https://github.com/clojure/tools.cli/blob/3c8956096444d5d6f81d46401a00ac2e2e216aa0/src/main/clojure/clojure/tools/cli.clj#L419",
29+
:added "0.3.2",
30+
:raw-source-url
31+
"https://github.com/clojure/tools.cli/raw/3c8956096444d5d6f81d46401a00ac2e2e216aa0/src/main/clojure/clojure/tools/cli.clj",
32+
:wiki-url
33+
"http://clojure.github.com/tools.cli//clojure.tools.cli-api.html#clojure.tools.cli/get-default-options",
34+
:doc
35+
"Extract the map of default options from a sequence of option vectors.",
36+
:var-type "function",
37+
:line 419,
2338
:file "src/main/clojure/clojure/tools/cli.clj"}
2439
{:arglists ([args option-specs & options]),
2540
:name "parse-opts",
2641
:namespace "clojure.tools.cli",
2742
:source-url
28-
"https://github.com/clojure/tools.cli/blob/ee7f1cc054689070a768c89d22713a02e3e34f6a/src/main/clojure/clojure/tools/cli.clj#L419",
43+
"https://github.com/clojure/tools.cli/blob/3c8956096444d5d6f81d46401a00ac2e2e216aa0/src/main/clojure/clojure/tools/cli.clj#L424",
2944
:added "0.3.0",
3045
:raw-source-url
31-
"https://github.com/clojure/tools.cli/raw/ee7f1cc054689070a768c89d22713a02e3e34f6a/src/main/clojure/clojure/tools/cli.clj",
46+
"https://github.com/clojure/tools.cli/raw/3c8956096444d5d6f81d46401a00ac2e2e216aa0/src/main/clojure/clojure/tools/cli.clj",
3247
:wiki-url
3348
"http://clojure.github.com/tools.cli//clojure.tools.cli-api.html#clojure.tools.cli/parse-opts",
3449
:doc
35-
"Parse arguments sequence according to given option specifications and the\nGNU Program Argument Syntax Conventions:\n\n https://www.gnu.org/software/libc/manual/html_node/Argument-Syntax.html\n\nOption specifications are a sequence of vectors with the following format:\n\n [short-opt long-opt-with-required-description description\n :property value]\n\nThe first three string parameters in an option spec are positional and\noptional, and may be nil in order to specify a later parameter.\n\nBy default, options are boolean flags that are set to true when toggled, but\nthe second string parameter may be used to specify that an option requires\nan argument.\n\n e.g. [\"-p\" \"--port PORT\"] specifies that --port requires an argument,\n of which PORT is a short description.\n\nThe :property value pairs are optional and take precedence over the\npositional string arguments. The valid properties are:\n\n :id The key for this option in the resulting option map. This\n is normally set to the keywordized name of the long option\n without the leading dashes.\n\n Multiple option entries can share the same :id in order to\n transform a value in different ways, but only one of these\n option entries may contain a :default entry.\n\n This option is mandatory.\n\n :short-opt The short format for this option, normally set by the first\n positional string parameter: e.g. \"-p\". Must be unique.\n\n :long-opt The long format for this option, normally set by the second\n positional string parameter; e.g. \"--port\". Must be unique.\n\n :required A description of the required argument for this option if\n one is required; normally set in the second positional\n string parameter after the long option: \"--port PORT\".\n\n The absence of this entry indicates that the option is a\n boolean toggle that is set to true when specified on the\n command line.\n\n :desc A optional short description of this option.\n\n :default The default value of this option. If none is specified, the\n resulting option map will not contain an entry for this\n option unless set on the command line.\n\n :default-desc An optional description of the default value. This should be\n used when the string representation of the default value is\n too ugly to be printed on the command line.\n\n :parse-fn A function that receives the required option argument and\n returns the option value.\n\n If this is a boolean option, parse-fn will receive the value\n true. This may be used to invert the logic of this option:\n\n [\"-q\" \"--quiet\"\n :id :verbose\n :default true\n :parse-fn not]\n\n :assoc-fn A function that receives the current option map, the current\n option :id, and the current parsed option value, and returns\n a new option map.\n\n This may be used to create non-idempotent options, like\n setting a verbosity level by specifying an option multiple\n times. (\"-vvv\" -> 3)\n\n [\"-v\" \"--verbose\"\n :default 0\n :assoc-fn (fn [m k _] (update-in m [k] inc))]\n\n :validate A vector of [validate-fn validate-msg ...]. Multiple pairs\n of validation functions and error messages may be provided.\n\n :validate-fn A vector of functions that receives the parsed option value\n and returns a falsy value or throws an exception when the\n value is invalid. The validations are tried in the given\n order.\n\n :validate-msg A vector of error messages corresponding to :validate-fn\n that will be added to the :errors vector on validation\n failure.\n\nparse-opts returns a map with four entries:\n\n {:options The options map, keyed by :id, mapped to the parsed value\n :arguments A vector of unprocessed arguments\n :summary A string containing a minimal options summary\n :errors A possible vector of error message strings generated during\n parsing; nil when no errors exist}\n\nA few function options may be specified to influence the behavior of\nparse-opts:\n\n :in-order Stop option processing at the first unknown argument. Useful\n for building programs with subcommands that have their own\n option specs.\n\n :summary-fn A function that receives the sequence of compiled option specs\n (documented at #'clojure.tools.cli/compile-option-specs), and\n returns a custom option summary string.\n",
50+
"Parse arguments sequence according to given option specifications and the\nGNU Program Argument Syntax Conventions:\n\n https://www.gnu.org/software/libc/manual/html_node/Argument-Syntax.html\n\nOption specifications are a sequence of vectors with the following format:\n\n [short-opt long-opt-with-required-description description\n :property value]\n\nThe first three string parameters in an option spec are positional and\noptional, and may be nil in order to specify a later parameter.\n\nBy default, options are toggles that default to nil, but the second string\nparameter may be used to specify that an option requires an argument.\n\n e.g. [\"-p\" \"--port PORT\"] specifies that --port requires an argument,\n of which PORT is a short description.\n\nThe :property value pairs are optional and take precedence over the\npositional string arguments. The valid properties are:\n\n :id The key for this option in the resulting option map. This\n is normally set to the keywordized name of the long option\n without the leading dashes.\n\n Multiple option entries can share the same :id in order to\n transform a value in different ways, but only one of these\n option entries may contain a :default entry.\n\n This option is mandatory.\n\n :short-opt The short format for this option, normally set by the first\n positional string parameter: e.g. \"-p\". Must be unique.\n\n :long-opt The long format for this option, normally set by the second\n positional string parameter; e.g. \"--port\". Must be unique.\n\n :required A description of the required argument for this option if\n one is required; normally set in the second positional\n string parameter after the long option: \"--port PORT\".\n\n The absence of this entry indicates that the option is a\n boolean toggle that is set to true when specified on the\n command line.\n\n :desc A optional short description of this option.\n\n :default The default value of this option. If none is specified, the\n resulting option map will not contain an entry for this\n option unless set on the command line.\n\n :default-desc An optional description of the default value. This should be\n used when the string representation of the default value is\n too ugly to be printed on the command line.\n\n :parse-fn A function that receives the required option argument and\n returns the option value.\n\n If this is a boolean option, parse-fn will receive the value\n true. This may be used to invert the logic of this option:\n\n [\"-q\" \"--quiet\"\n :id :verbose\n :default true\n :parse-fn not]\n\n :assoc-fn A function that receives the current option map, the current\n option :id, and the current parsed option value, and returns\n a new option map.\n\n This may be used to create non-idempotent options, like\n setting a verbosity level by specifying an option multiple\n times. (\"-vvv\" -> 3)\n\n [\"-v\" \"--verbose\"\n :default 0\n :assoc-fn (fn [m k _] (update-in m [k] inc))]\n\n :validate A vector of [validate-fn validate-msg ...]. Multiple pairs\n of validation functions and error messages may be provided.\n\n :validate-fn A vector of functions that receives the parsed option value\n and returns a falsy value or throws an exception when the\n value is invalid. The validations are tried in the given\n order.\n\n :validate-msg A vector of error messages corresponding to :validate-fn\n that will be added to the :errors vector on validation\n failure.\n\nparse-opts returns a map with four entries:\n\n {:options The options map, keyed by :id, mapped to the parsed value\n :arguments A vector of unprocessed arguments\n :summary A string containing a minimal options summary\n :errors A possible vector of error message strings generated during\n parsing; nil when no errors exist}\n\nA few function options may be specified to influence the behavior of\nparse-opts:\n\n :in-order Stop option processing at the first unknown argument. Useful\n for building programs with subcommands that have their own\n option specs.\n\n :no-defaults Only include option values specified in arguments and do not\n include any default values in the resulting options map.\n Useful for parsing options from multiple sources; i.e. from a\n config file and from the command line.\n\n :summary-fn A function that receives the sequence of compiled option specs\n (documented at #'clojure.tools.cli/compile-option-specs), and\n returns a custom option summary string.\n",
3651
:var-type "function",
37-
:line 419,
52+
:line 424,
3853
:file "src/main/clojure/clojure/tools/cli.clj"}
3954
{:arglists ([specs]),
4055
:name "summarize",
4156
:namespace "clojure.tools.cli",
4257
:source-url
43-
"https://github.com/clojure/tools.cli/blob/ee7f1cc054689070a768c89d22713a02e3e34f6a/src/main/clojure/clojure/tools/cli.clj#L400",
58+
"https://github.com/clojure/tools.cli/blob/3c8956096444d5d6f81d46401a00ac2e2e216aa0/src/main/clojure/clojure/tools/cli.clj#L408",
4459
:added "0.3.0",
4560
:raw-source-url
46-
"https://github.com/clojure/tools.cli/raw/ee7f1cc054689070a768c89d22713a02e3e34f6a/src/main/clojure/clojure/tools/cli.clj",
61+
"https://github.com/clojure/tools.cli/raw/3c8956096444d5d6f81d46401a00ac2e2e216aa0/src/main/clojure/clojure/tools/cli.clj",
4762
:wiki-url
4863
"http://clojure.github.com/tools.cli//clojure.tools.cli-api.html#clojure.tools.cli/summarize",
4964
:doc
5065
"Reduce options specs into a options summary for printing at a terminal.",
5166
:var-type "function",
52-
:line 400,
67+
:line 408,
5368
:file "src/main/clojure/clojure/tools/cli.clj"})}

index.html

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ <h1 class="nopad">Table of Contents</h1>
5656
<div style="margin-left: 1em;" class="toc-entry">
5757
<a class="toc-entry-anchor" href="#clojure.tools.cli/cli">cli</a>
5858

59+
</div><div style="margin-left: 1em;" class="toc-entry">
60+
<a class="toc-entry-anchor" href="#clojure.tools.cli/get-default-options">get-default-options</a>
61+
5962
</div><div style="margin-left: 1em;" class="toc-entry">
6063
<a class="toc-entry-anchor" href="#clojure.tools.cli/parse-opts">parse-opts</a>
6164

@@ -74,7 +77,7 @@ <h1 class="nopad">Table of Contents</h1>
7477
<p></p>
7578
<h2>Overview</h2>
7679
<div id="home-page">Project home page is <a href="http://github.com/clojure/tools.cli/">http://github.com/clojure/tools.cli/</a></div>
77-
<pre id="namespace-docstr"></pre>
80+
<pre id="namespace-docstr">Tools for working with command line arguments.</pre>
7881

7982

8083
<br />
@@ -111,7 +114,18 @@ <h2 id="clojure.tools.cli/cli">cli</h2>
111114
documentation banner to provide usage instructions.</pre>
112115

113116

114-
<a href="https://github.com/clojure/tools.cli/blob/ee7f1cc054689070a768c89d22713a02e3e34f6a/src/main/clojure/clojure/tools/cli.clj#L179" id="var-source">Source</a>
117+
<a href="https://github.com/clojure/tools.cli/blob/3c8956096444d5d6f81d46401a00ac2e2e216aa0/src/main/clojure/clojure/tools/cli.clj#L180" id="var-source">Source</a>
118+
</div><div id="var-entry">
119+
<br />
120+
<hr />
121+
<h2 id="clojure.tools.cli/get-default-options">get-default-options</h2>
122+
<span id="var-type">function</span><br />
123+
<pre id="var-usage">Usage: (get-default-options option-specs)
124+
</pre>
125+
<pre id="var-docstr">Extract the map of default options from a sequence of option vectors.</pre>
126+
<span class="var-added"><span id="content">Added in Command-line processor version 0.3.2</span><br /></span>
127+
128+
<a href="https://github.com/clojure/tools.cli/blob/3c8956096444d5d6f81d46401a00ac2e2e216aa0/src/main/clojure/clojure/tools/cli.clj#L419" id="var-source">Source</a>
115129
</div><div id="var-entry">
116130
<br />
117131
<hr />
@@ -132,9 +146,8 @@ <h2 id="clojure.tools.cli/parse-opts">parse-opts</h2>
132146
The first three string parameters in an option spec are positional and
133147
optional, and may be nil in order to specify a later parameter.
134148

135-
By default, options are boolean flags that are set to true when toggled, but
136-
the second string parameter may be used to specify that an option requires
137-
an argument.
149+
By default, options are toggles that default to nil, but the second string
150+
parameter may be used to specify that an option requires an argument.
138151

139152
e.g. ["-p" "--port PORT"] specifies that --port requires an argument,
140153
of which PORT is a short description.
@@ -226,13 +239,18 @@ <h2 id="clojure.tools.cli/parse-opts">parse-opts</h2>
226239
for building programs with subcommands that have their own
227240
option specs.
228241

242+
:no-defaults Only include option values specified in arguments and do not
243+
include any default values in the resulting options map.
244+
Useful for parsing options from multiple sources; i.e. from a
245+
config file and from the command line.
246+
229247
:summary-fn A function that receives the sequence of compiled option specs
230248
(documented at #'clojure.tools.cli/compile-option-specs), and
231249
returns a custom option summary string.
232250
</pre>
233251
<span class="var-added"><span id="content">Added in Command-line processor version 0.3.0</span><br /></span>
234252

235-
<a href="https://github.com/clojure/tools.cli/blob/ee7f1cc054689070a768c89d22713a02e3e34f6a/src/main/clojure/clojure/tools/cli.clj#L419" id="var-source">Source</a>
253+
<a href="https://github.com/clojure/tools.cli/blob/3c8956096444d5d6f81d46401a00ac2e2e216aa0/src/main/clojure/clojure/tools/cli.clj#L424" id="var-source">Source</a>
236254
</div><div id="var-entry">
237255
<br />
238256
<hr />
@@ -243,7 +261,7 @@ <h2 id="clojure.tools.cli/summarize">summarize</h2>
243261
<pre id="var-docstr">Reduce options specs into a options summary for printing at a terminal.</pre>
244262
<span class="var-added"><span id="content">Added in Command-line processor version 0.3.0</span><br /></span>
245263

246-
<a href="https://github.com/clojure/tools.cli/blob/ee7f1cc054689070a768c89d22713a02e3e34f6a/src/main/clojure/clojure/tools/cli.clj#L400" id="var-source">Source</a>
264+
<a href="https://github.com/clojure/tools.cli/blob/3c8956096444d5d6f81d46401a00ac2e2e216aa0/src/main/clojure/clojure/tools/cli.clj#L408" id="var-source">Source</a>
247265
</div>
248266
</div>
249267

0 commit comments

Comments
 (0)