Esempio n. 1
0
 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;
 }
Esempio n. 2
0
        /// <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);
            }
        }
Esempio n. 3
0
 public ConsoleArgument(string fullName, string alias, ArgumentValueType type = ArgumentValueType.NONE)
 {
     FullName  = fullName;
     Alias     = alias;
     ValueType = type;
 }
Esempio n. 4
0
 public ConsoleArgument(string fullName, ArgumentValueType type = ArgumentValueType.NONE)
 {
     FullName  = fullName;
     ValueType = type;
 }
Esempio n. 5
0
 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;
 }
Esempio n. 6
0
        /// <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);
            }
        }