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

Reducing public surface of CommandLine.IParser #55

Closed
gsscoder opened this issue Feb 18, 2013 · 1 comment
Closed

Reducing public surface of CommandLine.IParser #55

gsscoder opened this issue Feb 18, 2013 · 1 comment

Comments

@gsscoder
Copy link
Owner

My current level of skill / knowledge disagree that this interface (and main implementation CommandLine.Parser) exposes so much overloads.

I'm thinking to reduce with this philosophy:

  • Prefer constructor (both settings instance / lambda config) to specify preferences.
  • Provide flexible alternatives over redundancy.

Few examples:

You know that if you set an TextWriter for help output in settings, you can override the value with this overload?
bool ParseArguments(string[] args, object options, TextWriter helpWriter)

I'm sorry but mr. overload, I think I'm gonna kill you! :D

And all ParseArgumentStrict(...) can be reduced to:

bool ParseArgumentsStrict(string[] args, object options, Action onFail = null);

I'm quite to near to next RC0, so opinions are welcome. Support me or try to make me change idea...

@gsscoder
Copy link
Owner Author

Implemented in 1.9.5.0 rc0.

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

No branches or pull requests

1 participant