public Argument(string parameterName, ArgumentType allowType, ArgumentValueType valueType, string shortName, string parameterHelp) { this.Name = parameterName; this.AllowType = allowType; this.ValueType = valueType; this.Help = parameterHelp; this.ShortName = shortName; }
/// <summary> /// Defines the argument that the commandline utility supports. /// </summary> /// <param name="argType">Argument type.</param> /// <param name="parameterName">Name of the parameter.</param> /// <param name="argValueType">Defines the argument value type (int or string or bool) for the argument.</param> /// <param name="shortName">ShortName or alias for the argument.</param> /// <param name="helpDesc">Description of the argument.</param> public void Parameter(ArgumentType argType, string parameterName, ArgumentValueType argValueType, string shortName, string helpDesc) { // For the first value without parameter name only type string is accepted. if (string.IsNullOrEmpty(parameterName) && argValueType != ArgumentValueType.String) { throw new Exception("For the first value (without parameter name) only type ValueType.String is accepted! "); } Argument param = new Argument(parameterName, argType, argValueType, shortName, helpDesc); this.argumentList.Add(param.Name, param); if (!string.IsNullOrEmpty(param.ShortName)) { this.paramNameAliasMap.Add(shortName, parameterName); } }
public ConsoleArgument(string fullName, string alias, ArgumentValueType type = ArgumentValueType.NONE) { FullName = fullName; Alias = alias; ValueType = type; }
public ConsoleArgument(string fullName, ArgumentValueType type = ArgumentValueType.NONE) { FullName = fullName; ValueType = type; }