public ConsoleArgParser(ConsoleArgParserConfig config) { if (config == null) { throw new ArgumentNullException("config"); } this.Config = config; }
public ConsoleArgParser(string commands, string commandShortNames = "") { this.Config = new ConsoleArgParserConfig(); this.Config.Commands = commands; this.Config.CommandShortNames = commandShortNames; if (!string.IsNullOrEmpty(commands) && !string.IsNullOrEmpty(commandShortNames)) { var arr1 = commands.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); var arr2 = commandShortNames.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); if (arr1.Length != arr2.Length) { throw new ArgumentException("Commands and their shortnames do not match"); } } }
public ConsoleArgParser() { this.Config = new ConsoleArgParserConfig(); }