- argument
- A string containing the option to parse into its constituent parts.
- flag
- A string reference which will be set to null if the method returns false, or set to the flag the option starts with if the method returns true. Valid flags include: -, --, and /.
- name
- A string reference which will be set to null if the method returns false, or set to the option name following a valid flag if the method returns true. No lookup is made to determine that flag has been registered via a prior call to OptionSet.Add(Option) or related overload.
- sep
- A string reference which will be set to null if either the method returns false or if = or : was not found within argument; if the method returns true and argument contains a = or :, then sep will contain either = or :, whichever was found within argument.
- value
- A string reference which will be set to null if either the method returns false or if sep is null; if the method returns true and sep is not null, then value will contain all text after sep.
true if argument could be split into its constituent parts, and flag and name are set (sep and value may not be set, depending on whether or not they are present within argument); true if argument is not the possible start of a valid option.
Type Reason ArgumentNullException argument is null.
Subclasses can call this method from their OptionSet.Parse(string, OptionContext) method to determine whether a given string is an option, and to split the option up for further processing.
For example, GetOptionParts("foo", ...) would return false, while GetOptionParts("--foo=bar", ...) would result in flag containing --, name containing foo, sep containing =, and value containing bar.