-
Notifications
You must be signed in to change notification settings - Fork 481
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add setting to interpret options starting with a single dash as long named options #767
base: develop
Are you sure you want to change the base?
Add setting to interpret options starting with a single dash as long named options #767
Conversation
Thank you for submitting. Your pull request looks comprehensive, and good job with adding the tests. I believe this warrants a minor version bump to 2.10 I'm a little apprehensive about deviating from the original getopt specs but I do see the benefit of migration (ahem Nuget.exe) and similar. |
Oh great, it would be really nice if this could be merged, so there is no need for our dev team to maintain a local fork anymore. |
95fde13
to
10432f1
Compare
OK, I updated the PR. There were hard coded occurrences of By the way this new mode is almost in use for one year in our business application and we received no issues from our customers, so it is kind of tested externally already. :) So from my perspective this PR is ready to be merged, if you don't have any further suggestions. |
Any chance this can be reviewed and merged? It would be a very much welcome improvement! |
This PR does exactly what we want to achieve in our application. It would be great if single dashes would be an option in the CommandLine library. We really like the functionality and how this library provides an easy to use and easy to maintain command line support. Unfortunately we also have the hard requirement to use single dashes. Merging this would be great :-) |
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.