Skip to content
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

Added Windows Style LongName ("/") to Options along with the required… #40

Closed
ericnewton76 opened this issue Nov 4, 2017 · 4 comments

Comments

@ericnewton76
Copy link
Member

Issue by Rusk85
Saturday Aug 15, 2015 at 22:02 GMT
Originally opened as gsscoder/commandline#224


… unit tests. I have refrained from altering the core logic. Instead I added two overloaded methods for Parser.ParseArguments(...) with an additional optional parameter "useWinStyleOptions" which is set to true per default. From there on I simply check all arguments for the win style flag ("/") and replace them with the stock double dashes ("--"). The result I pass to the original ParseArguments-Methods.

While as a personal preference I take unix style options over windows style options every day but there is a remote service I am using that is among other things capable of executing applications. I cant easily change the service - its fairly old and written in vb.net - but I checked the implementation. Turns out its capable of interpreting windows style options and passing that to the application it starts. So there you go.

There might be others in a similar situation to whom this could be a possible solution.

Please review the code.


Rusk85 included the following code: https://github.com/gsscoder/commandline/pull/224/commits

@ericnewton76
Copy link
Member Author

Comment by nemec
Saturday Aug 15, 2015 at 23:16 GMT


The only problem I can think of here is how to enforce using only long names. Short names will still require a - and I can imagine a developer who doesn't know/forgets and gets confused.

Otherwise, this might be a nice compromise for #108. I think you could even implement this as an extension method under a different namespace (like CommandLine.Windows) to reinforce the fact that the UNIX way is preferred.

@ericnewton76
Copy link
Member Author

Comment by gsscoder
Sunday Aug 16, 2015 at 06:26 GMT


@Rusk85, thanks for PR. This is also discussed in #108, as stated by @nemec.

I'm forced to temporary delays any PR except fixes as explained here in #213 announcement, until project reaches STABLE status.

Anyway I'll accept fixes.

Thank you! :)

@johnjaylward
Copy link
Contributor

looks like a dup of #15

@moh-hassan
Copy link
Collaborator

DUP #15

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants