GetOptions icon indicating copy to clipboard operation
GetOptions copied to clipboard

Preserve bundled options in argv when using limit-*

Open Alhadis opened this issue 8 years ago • 0 comments

Bundles such as -mvl2 are expanded to become -m -v -l 2 before the argument list is evaluated. If multipleOptions is set to limit-first or limit-last, the superfluous options are returned to the argv array in their modified, expanded forms.

$ program -s20vl -s 40
# result.argv: [ -s, 20, v, l ]
# result.options: { s: 40 }

Ideally, they should be preserved verbatim, since they're not being interpreted as options, so the above scenario should result in this instead:

$ program -s20vl -s 40
# result.argv: [ -s20 ]
# result.options: { v: true, l: true, s: 40 }

(These examples assume multipleOptions is set to limit-last).

Alhadis avatar Dec 07 '15 13:12 Alhadis