Handbook
Glossary
(parse-arguments) ( optional positional command-line -- positional' )
Vocabulary
command-line
.
parser
.
private
Inputs
optional
an
object
positional
an
object
command-line
an
object
Outputs
positional'
an
object
Definition
USING:
kernel
sequences
sequences.extras
;
IN:
command-line.parser.private
:
(parse-arguments)
( optional positional command-line -- positional' )
[
pick
empty?
[
f
]
[
1
over
[
"-"
head?
]
find-from
drop
[
cut
]
[
f
]
if*
]
if
[
pick
empty?
[
f
]
[
dup
first
"-"
head?
]
if
[
overd
parse-optional
]
[
[
?unclip
]
dip
over
[
parse-positional
]
[
unrecognized-arguments
]
if
]
if
]
dip
append
]
until-empty
nip
;