You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Consider this generic approach, I think it's better for developers, simpler pattern:
static void Main(string[] args) {
var options = CommandLine.Parser.Default.ParseArguments<Options>(args);
if (options.Available)
// Values are available here
if (options.Verbose) Console.WriteLine("Filename: {0}", options.InputFile);
}
just a thought...
The text was updated successfully, but these errors were encountered:
varoptions=CommandLine.Parser.Default.ParseArguments<Options>(args).Value;if(options!=default){// ... do something with your options}
If you want both the parsed options and the errors, you would do something like this:
varparsed=CommandLine.Parser.Default.ParseArguments<Options>(args);if(parsed.Value!=default){// ... do something with your options}else{// ... do something with Parsed.Errors}
@Korporal, not sure if you still care, but since you opened this issue initially, I thought I'd tag you that a PR has been created that is similar to your requested syntax
Monday Sep 04, 2017 at 15:28 GMT
Originally opened as gsscoder/commandline#476
Hi,
Consider this generic approach, I think it's better for developers, simpler pattern:
just a thought...
The text was updated successfully, but these errors were encountered: