public IAliasable AddAlias(IEnumerable <string> ieAliasable) { foreach (string s in ieAliasable) { AliasList.Add(s); } return(this); }
/// <summary> /// Adds an alias to this command. /// </summary> /// <param name="alias">Alias to add to the command.</param> /// <returns>This builder.</returns> public CommandBuilder WithAlias(string alias) { if (alias.ToCharArray().Any(xc => char.IsWhiteSpace(xc))) { throw new ArgumentException("Aliases cannot contain whitespace characters or null strings.", nameof(alias)); } if (Name == alias || AliasList.Contains(alias)) { throw new ArgumentException("Aliases cannot contain the command name, and cannot be duplicate.", nameof(alias)); } AliasList.Add(alias); return(this); }
public IAliasable AddAlias(string sAliasable) { AliasList.Add(sAliasable); return(this); }