示例#1
0
文件: Options.cs 项目: vansha/Nake
 public void Terminate()
 {
     if (!IsEmpty() && !IsComplete())
     {
         throw OptionParseException.IncompleteArgument(name);
     }
 }
示例#2
0
文件: Options.cs 项目: vansha/Nake
            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);
            }