ParseOptionsNameValueSeparators Property

Gets or sets the characters used to separate the name and the value of an argument.

Definition

Namespace: Ookii.CommandLine
Assembly: Ookii.CommandLine (in Ookii.CommandLine.dll) Version: 4.2.0+a4d3631e4dcc0970081ed435288efdebc1325f83
C#
public IEnumerable<char>? NameValueSeparators { get; set; }

Property Value

IEnumerableChar
The character used to separate the name and the value of an argument, or to use the value from the ParseOptionsAttribute attribute, or if that is not present, the values returned by the CommandLineParserGetDefaultNameValueSeparators method, which are a colon (:) and an equals sign (=). The default value is .

Remarks

These characters are used to separate the name and the value if both are provided as a single argument to the application, e.g. -sample:value or -sample=value if the default value is used.

  Note

The characters chosen here cannot be used in the name of any parameter. Therefore, it's usually best to choose a non-alphanumeric value such as the colon or equals sign. The characters can appear in argument values (e.g. -sample:foo:bar is fine, in\ which case the value is "foo:bar").

  Note

Do not pick a white-space character as the separator. Doing this only works if the white-space character is part of the argument token, which usually means it needs to be quoted or escaped when invoking your application. Instead, use the AllowWhiteSpaceValueSeparator property to control whether white space is allowed as a separator.

If not , this property overrides the value of the ParseOptionsAttributeNameValueSeparators property.

See Also