Handbook
Glossary
with-options ( ... options quot: ( ... -- ... ) -- ... )
Parsing command-line arguments
Next:
parse-options ( options -- arguments )
Vocabulary
command-line
.
parser
Inputs
options
an
object
quot
a
quotation
with stack effect
( ... -- ... )
Outputs
None
Definition
USING:
command-line.parser.private
continuations
debugger
io
kernel
namespaces
;
IN:
command-line.parser
:
with-options
( ... options quot: ( ... -- ... ) -- ... )
[
[
parse-options
]
curry
]
dip
[
with-variables
]
curry
compose
[
dup
option-error?
[
dup
usage-error?
[
"ERROR: "
write
]
unless
print-error
]
[
rethrow
]
if
]
recover
;
inline