Closed huntzhan closed 9 years ago
Purpose of preprocessing is to simplify the argv matching algorithm.
Order of actions:
=
,
--
GROUPED_OPTIONS
And finally, only three kinds of tokens would be passed to argv match algorithm:
POSIX_OPTION
GNU_OPTION
GENERAL_ELEMENT
Token with type of GENERAL_ELEMENT could be an option argument, or an operand, or a command.
drawbacks of argv processing in v0.1 are as follow:
v0.1
options
such drawback should be overcame in v0.2.
v0.2
Purpose of preprocessing is to simplify the argv matching algorithm.
Order of actions:
=
,,
).[Guideline 8]check binding pairs indicated by=
; remove appearance of=
.--
.(reuse #12)[Guideline 10]GROUPED_OPTIONS
.(recuse #9 and #6)[Guideline 5, exceptions]And finally, only three kinds of tokens would be passed to argv match algorithm:
POSIX_OPTION
.GNU_OPTION
.GENERAL_ELEMENT
.Token with type of
GENERAL_ELEMENT
could be an option argument, or an operand, or a command.