Handbook
Glossary
option-meta ( option -- meta/f )
Vocabulary
command-line
.
parser
.
private
Inputs
option
an
object
Outputs
meta/f
an
object
Definition
USING:
accessors
combinators
combinators.short-circuit
formatting
kernel
sequences
unicode
;
IN:
command-line.parser.private
:
option-meta
( option -- meta/f )
dup
option-#args
[
[
{
[
meta>>
]
[
option-name
]
}
1||
>upper
]
dip
{
{
"+"
[
dup
"%s [%s ...]"
sprintf
]
}
{
"*"
[
"[%s ...]"
sprintf
]
}
{
"?"
[
"[%s]"
sprintf
]
}
[
swap
<repetition>
" "
join
]
}
case
]
[
drop
f
]
if*
;