@@ -24,7 +24,7 @@ this into complete documentation for the library, with examples, over time):
24
24
By default, options are toggles that default to nil, but the second string
25
25
parameter may be used to specify that an option requires an argument.
26
26
27
- e.g. [\ "-p\" \ "--port PORT\ "] specifies that --port requires an argument,
27
+ e.g. ["-p" "--port PORT"] specifies that --port requires an argument,
28
28
of which PORT is a short description.
29
29
30
30
The :property value pairs are optional and take precedence over the
@@ -38,17 +38,18 @@ this into complete documentation for the library, with examples, over time):
38
38
transform a value in different ways, but only one of these
39
39
option entries may contain a :default(-fn) entry.
40
40
41
- This option is mandatory.
41
+ This option is mandatory if no long option is provided .
42
42
43
43
:short-opt The short format for this option, normally set by the first
44
- positional string parameter: e.g. \ "-p\ ". Must be unique.
44
+ positional string parameter: e.g. "-p". Must be unique.
45
45
46
46
:long-opt The long format for this option, normally set by the second
47
- positional string parameter; e.g. \ "--port\ ". Must be unique.
47
+ positional string parameter; e.g. "--port". Must be unique.
48
48
49
49
:required A description of the required argument for this option if
50
50
one is required; normally set in the second positional
51
- string parameter after the long option: \"--port PORT\".
51
+ string parameter after the long option: "--port PORT",
52
+ which would be equivalent to :required "PORT".
52
53
53
54
The absence of this entry indicates that the option is a
54
55
boolean toggle that is set to true when specified on the
@@ -93,7 +94,7 @@ this into complete documentation for the library, with examples, over time):
93
94
If this is a boolean option, parse-fn will receive the value
94
95
true. This may be used to invert the logic of this option:
95
96
96
- [\ "-q\" \ "--quiet\ "
97
+ ["-q" "--quiet"
97
98
:id :verbose
98
99
:default true
99
100
:parse-fn not]
@@ -118,16 +119,16 @@ this into complete documentation for the library, with examples, over time):
118
119
119
120
This may be used to create non-idempotent options where you
120
121
only need the current value, like setting a verbosity level by
121
- specifying an option multiple times. (\ "-vvv\ " -> 3)
122
+ specifying an option multiple times. ("-vvv" -> 3)
122
123
123
- [\ "-v\" \ "--verbose\ "
124
+ ["-v" "--verbose"
124
125
:default 0
125
126
:update-fn inc]
126
127
127
128
:default is applied first. If you wish to omit the :default
128
129
option value, use fnil in your :update-fn as follows:
129
130
130
- [\ "-v\" \ "--verbose\ "
131
+ ["-v" "--verbose"
131
132
:update-fn (fnil inc 0)]
132
133
133
134
With :multi true:
@@ -141,15 +142,15 @@ this into complete documentation for the library, with examples, over time):
141
142
value based on the current value and a new value from the
142
143
command line. This can sometimes be easier than use :assoc-fn.
143
144
144
- [\ "-f\" \ "--file NAME\ "
145
+ ["-f" "--file NAME"
145
146
:default []
146
147
:update-fn conj
147
148
:multi true]
148
149
149
150
:default is applied first. If you wish to omit the :default
150
151
option value, use fnil in your :update-fn as follows:
151
152
152
- [\ "-f\" \ "--file NAME\ "
153
+ ["-f" "--file NAME"
153
154
:update-fn (fnil conj [])
154
155
:multi true]
155
156
0 commit comments