The code here is only a quick bandaid, because an option with an argument right before the double dash will swallow the double dash. For example, <command> --grab-str -- --option will result in -- being the value of :grab-str and --option getting parsed as an option.
However, under normal use, the double dash code is useful.
--
now signals start of operands.The code here is only a quick bandaid, because an option with an argument right before the double dash will swallow the double dash. For example,
<command> --grab-str -- --option
will result in--
being the value of:grab-str
and--option
getting parsed as an option.However, under normal use, the double dash code is useful.