Skip to content

ConsoleArguments

Console arguments to be parsed at program startup.

Methods

ConsoleArguments Add(string prototype, Action setOptionValue, string description, string propertyName)

Add an argument to the list of known arguments Each argument can supply their value to a property using an For strings, simply set the valuev => PropertyName = vFor booleans, check if the string is null; e.g.v => PropertyName = !string.IsNullOrEmpty(v)For lists, add it to the listv => PropertyName.Add(v)

ConsoleArguments Add(string prototype, Action setOptionValue, string description, string propertyName, Nullable required, bool exitIfUsed)

Add an argument to the list of known arguments Each argument can supply their value to a property using an For strings, simply set the valuev => PropertyName = vFor booleans, check if the string is null; e.g.v => PropertyName = !string.IsNullOrEmpty(v)For lists, add it to the listv => PropertyName.Add(v)

ConsoleArguments Add(string prototype, Action setOptionValue, string description, string propertyName, Func getIsRequired, bool exitIfUsed)

Add an argument to the list of known arguments Each argument can supply their value to a property using an For strings, simply set the valuev => PropertyName = vFor booleans, check if the string is null; e.g.v => PropertyName = !string.IsNullOrEmpty(v)For lists, add it to the listv => PropertyName.Add(v)The Is Required is dynamically determined by a function.

ConsoleArguments Insert(int index, ICustomArgument argument)

Insert Common Argument

ConsoleArguments Add(ICustomArgument argument)

Add Common Argument

void ParseAndValidate(String[] args, string programName, bool exitOnFailureToParse)

void WriteGeneralHelp(string programName)