This file is indexed.

/usr/share/doc/libtools-cli-clojure/html/README.html is in libtools-cli-clojure 0.2.4-2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>tools.cli</title>
</head>
<body><h1>tools.cli</h1>

<p>tools.cli is a command line argument parser for Clojure.</p>

<h2>Releases and Dependency Information</h2>

<p>Latest stable release: 0.2.3</p>

<ul>
<li><a href="http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22org.clojure%22%20AND%20a%3A%22tools.cli%22">All Released Versions</a></li>
<li><a href="https://oss.sonatype.org/index.html#nexus-search;gav~org.clojure~tools.cli~~~">Development Snapshot Versions</a></li>
</ul>

<p><a href="https://github.com/technomancy/leiningen">Leiningen</a> dependency information:</p>

<pre><code>[org.clojure/tools.cli "0.2.3"]
</code></pre>

<p><a href="http://maven.apache.org/">Maven</a> dependency information:</p>

<pre><code>&lt;dependency&gt;
  &lt;groupId&gt;org.clojure&lt;/groupId&gt;
  &lt;artifactId&gt;tools.cli&lt;/artifactId&gt;
  &lt;version&gt;0.2.3&lt;/version&gt;
&lt;/dependency&gt;
</code></pre>

<h2>Example Usage</h2>

<pre><code>(use '[clojure.tools.cli :only [cli]])

(cli args
     ["-p" "--port" "Listen on this port" :parse-fn #(Integer. %)
      :assoc-fn (fn [previous key val]
                   (assoc previous key
                          (if-let [oldval (get previous key)]
                            (merge oldval val)
                            (hash-set val))))] 
     ["-h" "--host" "The hostname" :default "localhost"]
     ["-v" "--[no-]verbose" :default true]
     ["-l" "--log-directory" :default "/some/path"])
</code></pre>

<p>with args of:</p>

<pre><code>["-p" "8080"
 "-p" "9090"
 "--no-verbose"
 "--log-directory" "/tmp"
 "some-file"]
</code></pre>

<p>will return a vector containing three elements:</p>

<p>a clojure map with the names picked out for you as keywords:</p>

<pre><code> {:port          #{8080 9090}
  :host          "localhost"
  :verbose       false
  :log-directory "/tmp"}
</code></pre>

<p>a vector of trailing arguments that are not options:</p>

<pre><code>["some-file"]
</code></pre>

<p>and a documentation string to use to provide help:</p>

<pre><code>"Switches                    Default     Desc          
 --------                    -------     ----          
 -p, --port                              Listen on this port              
 -h, --host                  localhost   The hostname     
 -v, --no-verbose --verbose  true                      
 -l, --log-directory         /some/path"   
</code></pre>

<h3>Custom description</h3>

<p>You can pass an optional description argument that will be shown
between "Usage:" and the description of the switches. For example:</p>

<pre><code>(cli args
     "This program does something extraordinary."
     ["-p" "--port" "Listen on this port" :parse-fn #(Integer. %)] 
     ["-h" "--host" "The hostname" :default "localhost"])
</code></pre>

<p>The documentation string will now look like:</p>

<pre><code>"This program does something extraordinary.

 Switches                    Default     Desc          
 --------                    -------     ----          
 -p, --port                              Listen on this port              
 -h, --host                  localhost   The hostname"
</code></pre>

<h2>Options</h2>

<p>An option is specified by providing a vector of information:</p>

<p>Switches should be provided first, from least to most specific. The
last switch you provide will be used as the name for the argument in
the resulting hash-map. The following:</p>

<pre><code>["-p" "--port"]
</code></pre>

<p>defines an argument with two possible switches, the name of which will
be :port in the resulting hash-map.</p>

<p>Next is an optional doc string:</p>

<pre><code>["-p" "--port" "The port to listen on"]
</code></pre>

<p>This will be printed in the 'Desc' column of the help banner. </p>

<p>Following that are optional parameters, provided in key-value pairs:</p>

<pre><code>["-p" "--port" "The port to listen on" :default 8080 :parse-fn #(Integer. %)
 :assoc-fn (fn [previous key val]
             (assoc previous key
                    (if-let [oldval (get previous key)]
                      (merge oldval val)
                      (hash-set val))))]
</code></pre>

<p>These should be self-explanatory. The defaults if not provided are as follows:</p>

<pre><code>{:default  nil
 :parse-fn identity
 :assoc-fn assoc
 :flag     false}
</code></pre>

<p>If you provide the same option multiple times, the <code>assoc-fn</code> will be
called for each value after the first. This gives you another way to
build collections of values (the other being using <code>parse-fn</code> to split
the value).</p>

<h3>Boolean Flags</h3>

<p>Flags are indicated either through naming convention:</p>

<pre><code>["-v" "--[no-]verbose" "Be chatty"]
</code></pre>

<p>(note the [no-] in the argument name).</p>

<p>Or you can explicitly mark them as flags:</p>

<pre><code>["-v" "--verbose" "Be chatty" :flag true]
</code></pre>

<p>Either way, when providing them on the command line, using the name
itself will set to true, and using the name prefixed with 'no-' will
set the argument to false:</p>

<pre><code>(cli ["-v"]
     ["-v" "--[no-]verbose"])

=&gt; [{:verbose true}, ...]

(cli ["--no-verbose"]
     ["-v" "--[no-]verbose"])

=&gt; [{:verbose false}, ...]
</code></pre>

<p>Note: there is no short-form to set the flag to false (-no-v will not
work!). </p>

<h2>Trailing Arguments</h2>

<p>Any trailing arguments given to <code>cli</code> are returned as the second item
in the resulting vector:</p>

<pre><code>(cli ["--port" "9999" "some" "extra" "arguments"]
     ["--port" :parse-fn #(Integer. %)])

=&gt; [{:port 9999}, ["some" "extra" "arguments"], ...]
</code></pre>

<p>This allows you to deal with parameters such as filenames which are
commonly provided at the end of an argument list.</p>

<p>If you wish to explicitly signal the end of arguments, you can use a
double-hyphen:</p>

<pre><code>(cli ["--port" "9999" "--" "some" "--extra" "arguments"]
     ["--port" :parse-fn #(Integer. %)])

=&gt; [{:port 9999}, ["some" "--extra" "arguments"], ...]
</code></pre>

<p>This is useful when your extra arguments look like switches.</p>

<h2>Banner</h2>

<p>The third item in the resulting vector is a banner useful for
providing help to the user:</p>

<pre><code>(let [[options args banner] (cli ["--faux" "bar"]
                                 ["-h" "--help" "Show help" :default false :flag true]
                                 ["-f" "--faux" "The faux du fafa"])]
  (when (:help options)
    (println banner)
    (System/exit 0))
  (println options))
</code></pre>

<h2>Developer Information</h2>

<ul>
<li><a href="https://github.com/clojure/tools.cli">GitHub project</a></li>
<li><a href="http://dev.clojure.org/jira/browse/TCLI">Bug Tracker</a></li>
<li><a href="http://build.clojure.org/job/tools.cli/">Continuous Integration</a></li>
<li><a href="http://build.clojure.org/job/tools.cli-test-matrix/">Compatibility Test Matrix</a></li>
</ul>

<h2>Change Log</h2>

<ul>
<li>Release 0.2.3 on 2013-08-06
<ul>
<li>Add optional description string to prefix the returned banner</li>
</ul></li>
<li>Release 0.2.2 on 2012-08-09
<ul>
<li>Applying patch for <a href="http://dev.clojure.org/jira/browse/TCLI-1">TCLI-1</a> 
(do not include keys when no value provided by :default)</li>
</ul></li>
<li>Release 0.2.1 on 2011-11-03
<ul>
<li>Removing the :required option. Hangover from when -h and --help were
implemented by default, causes problems if you want help and dont
provide a :required argument.</li>
</ul></li>
<li>Release 0.2.0 on 2011-10-31
<ul>
<li>Remove calls to System/exit</li>
<li>Remove built-in help options</li>
</ul></li>
<li>Release 0.1.0
<ul>
<li>Initial import of Clargon codebase</li>
</ul></li>
</ul>

<h2>License</h2>

<p>Copyright (c) Rich Hickey and contributors. All rights reserved.</p>

<p>The use and distribution terms for this software are covered by the
Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php)
which can be found in the file epl.html at the root of this distribution.
By using this software in any fashion, you are agreeing to be bound by
the terms of this license.
You must not remove this notice, or any other, from this software.</p>
</body>
</html>