@@ -134,6 +134,14 @@ type ArgPlaceHolder = String
134
134
135
135
-- | Create an option taking a single OptDescr.
136
136
-- No explicit Name is given for the Option, the name is the first LFlag given.
137
+ --
138
+ -- Example: @'option' sf lf d get set@
139
+ -- * @sf@: Short option name, for example: @[\'d\']@. No hyphen permitted.
140
+ -- * @lf@: Long option name, for example: @["debug"]@. No hyphens permitted.
141
+ -- * @d@: Description of the option, shown to the user in help messages.
142
+ -- * @get@: Get the current value of the flag.
143
+ -- * @set@: Set the value of the flag. Gets the current value of the flag as a
144
+ -- parameter.
137
145
option :: SFlags -> LFlags -> Description -> get -> set -> MkOptDescr get set a
138
146
-> OptionField a
139
147
option sf lf@ (n: _) d get set arg = OptionField n [arg sf lf d get set]
@@ -153,6 +161,15 @@ type MkOptDescr get set a = SFlags -> LFlags -> Description -> get -> set
153
161
-> OptDescr a
154
162
155
163
-- | Create a string-valued command line interface.
164
+ -- Usually called in the context of 'option' or 'multiOption'.
165
+ --
166
+ -- Example: @'reqArg' ad mkflag showflag@
167
+ --
168
+ -- * @ad@: Placeholder shown to the user, e.g. @"FILES"@ if files are expected
169
+ -- parameters.
170
+ -- * @mkflag@: How to parse the argument into the option.
171
+ -- * @showflag@: If parsing goes wrong, display a useful error message to
172
+ -- the user.
156
173
reqArg :: Monoid b => ArgPlaceHolder -> ReadE b -> (b -> [String ])
157
174
-> MkOptDescr (a -> b ) (b -> a -> a ) a
158
175
reqArg ad mkflag showflag sf lf d get set =
0 commit comments