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
After upgrading to latest version (3.0.20), parsing now ignores the default value if the argument isn't defined in the arguments list. It instead will use the default value for the type. e.g. 0 for an int or enum.
publicenumOptionsFlag{O1,O2,O3}publicclassOptions{[ValueArgument(typeof(OptionsFlag),'f',"flag",DefaultValue=OptionsFlag.O3)]publicOptionsFlagFlag=OptionsFlag.O3;publicstaticOptionsParseOptions(string[]args){varoptions=newOptions();Debug.Assert(options.Flag==OptionsFlag.O3);varparser=newCommandLineParser.CommandLineParser();parser.ExtractArgumentAttributes(options);parser.ParseCommandLine(args);// This will fail when args is empty! it has been set to O1Debug.Assert(options.Flag==OptionsFlag.O3);returnoptions;}}
The text was updated successfully, but these errors were encountered:
After upgrading to latest version (3.0.20), parsing now ignores the default value if the argument isn't defined in the arguments list. It instead will use the default value for the type. e.g. 0 for an int or enum.
The text was updated successfully, but these errors were encountered: