Example #1
0
        public override string ToHelp(OptionArity arity, AbstractType valueType)
        {
            StringBuilder help = new StringBuilder();
            StringBuilder postfix = new StringBuilder();
            if (arity.MinimalOccurs == 0)
            {
                postfix.AppendFormat("[={0}]", valueType);
            }

            foreach (var sw in Switches)
            {
                help.AppendFormat("--{0}{1} ", sw, postfix);

            }

            return help.ToString();
        }
Example #2
0
 public abstract string ToHelp(OptionArity arity, AbstractType valueType);
Example #3
0
 public SwitchesManager(string shortSwitchesString, string longSwitchesString, OptionArity optionArity, AbstractType valueType)
 {
     bool intersectionIsEmpty = SwitchesIntersectionIsEmpty(shortSwitchesString, longSwitchesString);
     if (intersectionIsEmpty)
     {
         Short = new ShortSwitches(shortSwitchesString);
         Long = new LongSwitches(longSwitchesString);
     }
     else
     {
         throw new DuplicitOptionSwitchException("");
     }
 }
Example #4
0
 public string ToHelp(OptionArity arity, AbstractType valueType)
 {
     StringBuilder help = new StringBuilder();
     help.AppendFormat("{0}, {1}", Short.ToHelp(arity, valueType), Long.ToHelp(arity, valueType) );
     return help.ToString();
 }
Example #5
0
        public override string ToHelp(OptionArity arity, AbstractType valueType)
        {
            StringBuilder help = new StringBuilder();
            foreach (var sw in Switches)
            {
                help.AppendFormat("-{0}, ", sw);
            }

            return help.ToString();
        }