public void Parse()
        {
            if (_remaining == null)
            {
                return;
            }

            MemberSetter.SetRemainingArg(_t, _remaining, MakeStringArrayFromRemainingArgs());
        }
示例#2
0
 private void ParseOptionalArgumentWithOptionalArgument(string argName, MemberAttribute handler)
 {
     if (_argIt.MoveNext() == true)
     {
         MemberSetter.SetArg(_t, handler, _argIt.Current);
     }
     else
     {
         throw new Exception(string.Format("Missing value for argument for {0}", argName));
     }
 }
 public void Parse()
 {
     foreach (MemberAttribute arg in _required)
     {
         if (_argIt.MoveNext())
         {
             MemberSetter.SetArg(_t, arg, _argIt.Current);
         }
         else
         {
             throw new Exception("Number of required arguments and actual arguments don't match");
         }
     }
 }
示例#4
0
        private void ParseOptionalArgument()
        {
            string argName = ParseOptionalArgName(_argIt.Current);

            MemberAttribute handler = FindMatchingOptionOrThrow(argName);

            if (handler.HasOptionalArgument == false)
            {
                MemberSetter.SetOptionalFlagArg(_t, handler, true);
            }
            else
            {
                ParseOptionalArgumentWithOptionalArgument(argName, handler);
            }
        }