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

Survey for adding an AutoBuild(...) to the Parser #43

Closed
gsscoder opened this issue Jan 16, 2013 · 1 comment
Closed

Survey for adding an AutoBuild(...) to the Parser #43

gsscoder opened this issue Jan 16, 2013 · 1 comment

Comments

@gsscoder
Copy link
Owner

@nemec, strict parsing (suggested by you) led me to think that CoC (convention over configuration) is gaining consensus between developers (see ASP.NET MVC, see Grails in Java World etc).

What about something like this:

bool result = CommandLineParser.AutoParse(); // or CommandLineParser.Default.AutoParse() ???

Inside the method calls Environment.GetArgs() and inspect the assembly for a type marked with an attribute (or by naming convention), say

[ParserTarget] // <- maybe marking also the class is more explicit
class Options {
  // everything as usual here...
  [ParserTarget] // <- maybe the lib could use just this attr to discover the options type
  public static Options Instance {get; set;}
}

When ::AutoParse() returns (and if returns) true product of parsing will be dressed up into Options::Instance static member.

Opinions? (Everyone invited).

@gsscoder
Copy link
Owner Author

Still with no opinions, assumed of none interest.

If am I wrong, feel free to add comments anyway.

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