ParseOptionsAttributeNameValueSeparators 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.0.0+bb7ed9a8fdfd1cb21824750a8cf508863ad15086
C#
public char[]? NameValueSeparators { get; set; }

Property Value

Char
The characters used to separate the name and the value of an argument, or to use the default value from the CommandLineParserGetDefaultNameValueSeparators method, which is 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 character 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 character 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 whitespace character is part of the argument, 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.

This value can be overridden by the ParseOptionsNameValueSeparators property.

See Also