Beispiel #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();
        }
Beispiel #2
0
 public abstract string ToHelp(OptionArity arity, AbstractType valueType);
Beispiel #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("");
     }
 }
Beispiel #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();
 }
Beispiel #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();
        }