public CommandLineOption(string Name, string Description, bool ArgRequired, OptionEnabled Callback) { this.OptionName = Name; this.OptionDescription = Description; this.ArgumentRequired = ArgRequired; this.Callback = Callback; }
/// <summary> /// Adds a parseable option /// </summary> /// <param name="OptionName">Name of the option</param> /// <param name="OptionDescription">Description of the option</param> /// <param name="RequiresArgument">True if an argument is required</param> /// <param name="Callback">The callback to call if this option is parsed. May be null.</param> public void AddOption(string OptionName, string OptionDescription, bool RequiresArgument, OptionEnabled Callback = null) { if (IsOptionRegistered(OptionName)) { return; // Don't re-register an already existing option. } RegisteredOptions.Add(new CommandLineOption(OptionName, OptionDescription, RequiresArgument, Callback)); }