public void Terminate() { if (!IsEmpty() && !IsComplete()) { throw OptionParseException.IncompleteArgument(name); } }
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); }