public CommandLineParser MustHaveSwitch(string swtch, Action <string> hasSwitchAction)
 {
     if (!HasSwitch(swtch))
     {
         throw ParameterException.MissingParameter(swtch, ParameterException.ParameterTypes.Switch);
     }
     hasSwitchAction(swtch);
     _switches[swtch] = true;
     return(this);
 }
 public CommandLineParser MustHaveNamedArg(string name, Action <string> hasNamedArgAction)
 {
     if (!HasNamedArg(name))
     {
         throw ParameterException.MissingParameter(name, ParameterException.ParameterTypes.NamedParameter);
     }
     hasNamedArgAction(name);
     if (!_namedArgs[name].Item1)
     {
         _namedArgs[name] = new Tuple <bool, Stack <string> >(true, _namedArgs[name].Item2);
     }
     return(this);
 }