Beispiel #1
0
 public void Terminate()
 {
     if (!IsEmpty() && !IsComplete())
     {
         throw OptionParseException.IncompleteArgument(name);
     }
 }
Beispiel #2
0
            string GetValue(string[] args, int position)
            {
                if (!expectsValue)
                {
                    return(null);
                }

                var hasValue = position + 1 != args.Length;

                if (requiresValue && !hasValue)
                {
                    throw OptionParseException.MissingValue(keyword);
                }

                return(hasValue ? args[position + 1] : null);
            }