- argument
- A string containing the current option to parse.
- c
- A Mono.Options.OptionContext containing the current parser context.
A bool specifying whether or not argument was handled. If false, then OptionSet.Parse(IEnumerable<string>) will return argument as an unhandled option.
This method is called for each string within the IEnumerable<string> provided to OptionSet.Parse(IEnumerable<string>), which thus gives this method a chance to parse a single option, or chain together multiple options to form a single option (as is necessary when an option and its value are separated, e.g. with -option value).
The default implementation will check OptionContext.Option, which is assumed to be a Mono.Options.Option in need of a value. If OptionContext.Option is non-null, then argument is OptionValueCollection.Add(string)ed to OptionContext.OptionValues and Option.Invoke(OptionContext) is invoked.
Next, OptionSet.GetOptionParts(string, String@, String@, String@, String@) is invoked. If GetOptionParts returns false, then false is returned from Parse.
Finally, check to see if the name returned from GetOptionParts is registered; if it is, handle it appropriately. If it isn't, check to see if name is a bundled option or a boolean option. If name isn't any registered option, then false is returned. Otherwise, true is returned.
Inheriting types can override this method if they want to customize the per-option parsing within the containing OptionSet.Parse(IEnumerable<string>) invocation.
Inheriting types should consider overriding OptionSet.CreateOptionContext if they want to store extra information for use and retrieval during each Parse invocation.