Add setting to interpret options starting with a single dash as long named options #767
+310
−54
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds a setting to use single dashes for command line options.
As several others in issue #685 we wanted to switch to this library, since it is more robust than other libraries available. But due to backwards compatibility we needed to support single dashes instead of double dashes for options else we would break our customer's scripts.
So we forked this library and added an option for single dash support and now would like to bring this to the official repo.
There is a new setting
OptionsParseMode
inParserSettings
With three modes:
Default
is identical to the current behaviorOptions that start with a double dash must be defined using their full name.
(e.g.
git rebase --interactive
)Options that start with a single dash are interpreted as list of short named options.
(e.g.
git clean -xdf
)SingleOrDoubleDash
Options that start with a single or double dash are interpreted as short or full named option.
(e.g.
git rebase --interactive
orgit rebase -interactive
orgit rebase --i
orgit rebase -i
, butgit clean -xdf
would no longer be possible)SingleDashOnly
Options that start with a single dash are interpreted as short or full named option.
(e.g.
git rebase -interactive
orgit rebase -i
)Options that start with a double dash are considered as an invalid input.
(e.g.
git rebase --interactive
would no longer be possible)It would be great if you could consider this feature, since there are several library consumers that are looking for this option.