/// <summary> /// Adds an overload to this command. An executable command needs to have at least one overload. /// </summary> /// <param name="overload">Overload to add to this command.</param> /// <returns>This builder.</returns> public CommandBuilder WithOverload(CommandOverloadBuilder overload) { if (this.OverloadArgumentSets.Contains(overload.ArgumentSet)) { throw new DuplicateOverloadException(this.Name, overload.Arguments.Select(x => x.Type).ToList(), overload.ArgumentSet); } this.OverloadArgumentSets.Add(overload.ArgumentSet); this.OverloadList.Add(overload); return(this); }
/// <summary> /// Adds an overload to this command. An executable command needs to have at least one overload. /// </summary> /// <param name="overload">Overload to add to this command.</param> /// <returns>This builder.</returns> public CommandBuilder WithOverload(CommandOverloadBuilder overload) { if (this.OverloadArgumentSets.Contains(overload.ArgumentSet)) { throw new ArgumentException("An overload with specified argument sets already exists."); } this.OverloadArgumentSets.Add(overload.ArgumentSet); this.OverloadList.Add(overload); return(this); }