public ParserConfiguration( IReadOnlyCollection <Option> definedOptions, IReadOnlyCollection <char> argumentDelimiters = null, bool allowUnbundling = true) { if (definedOptions == null) { throw new ArgumentNullException(nameof(definedOptions)); } if (!definedOptions.Any()) { throw new ArgumentException("You must specify at least one option."); } if (definedOptions.All(o => !o.IsCommand)) { RootCommand = Create.RootCommand(definedOptions.ToArray()); DefinedOptions.Add(RootCommand); } else { DefinedOptions.AddRange(definedOptions); } ArgumentDelimiters = argumentDelimiters ?? new[] { ':', '=' }; AllowUnbundling = allowUnbundling; }
public Parser(params Option[] options) { if (options == null) { throw new ArgumentNullException(nameof(options)); } DefinedOptions.AddRange(options); }
public ParserConfiguration( IReadOnlyCollection <Option> definedOptions, IReadOnlyCollection <char> argumentDelimiters = null) { if (definedOptions == null) { throw new ArgumentNullException(nameof(definedOptions)); } if (!definedOptions.Any()) { throw new ArgumentException("You must specify at least one option."); } DefinedOptions.AddRange(definedOptions); ArgumentDelimiters = argumentDelimiters ?? new[] { ':', '=' }; }