-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
If a `--` delimiter is encountered, any remaining _non-option-value_ arguments must be handled as argument. From the POSIX spec (emphasis mine) https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap12.html#tag_12_0): > The first -- argument that *is not an option-argument* should be accepted > as a delimiter indicating the end of options. Any following arguments > should be treated as operands, even if they begin with the '-' character. There was a corner-case scenario, where a `--flag` followed by a `--` did not use `--` as value for the flag, but instead considered it as delimiter. As a result; foo test arg1 --opt -- arg2 Would be reordered as: foo test --opt arg1 arg2 Which caused `arg1` to be used as value for `--opt`, instead of `--`, which is the actual value. Signed-off-by: Sebastiaan van Stijn <[email protected]>
- Loading branch information
Showing
3 changed files
with
32 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters