ParseOptions.AutoPrefixAliases Property

Gets or sets a value that indicates whether unique prefixes of an argument are automatically used as aliases.

Definition

Namespace: Ookii.CommandLine
Assembly: Ookii.CommandLine (in Ookii.CommandLine.dll) Version: 5.0.0+724ca9b7fa5edc075ec2ae65044e61b0d494fd1c
C#
public bool? AutoPrefixAliases { get; set; }

Property Value

Nullable<Boolean>
true to automatically use unique prefixes of an argument as aliases for that argument; false to not have automatic prefixes; otherwise, null to use the value from the ParseOptionsAttribute.AutoPrefixAliases property, or if the ParseOptionsAttribute attribute is not present, true.

Remarks

If this property is true, the CommandLineParser class will consider any prefix that uniquely identifies an argument by its name or one of its explicit aliases as an alias for that argument. For example, given two arguments "Port" and "Protocol", "Po" and "Por" would be an alias for "Port", and "Pr" an alias for "Protocol" (as well as "Pro", "Prot", "Proto", etc.). "P" would not be an alias because it doesn't uniquely identify a single argument.

When using ParsingMode.LongShort, this only applies to long names. Explicit aliases set with the AliasAttribute take precedence over automatic aliases. Automatic prefix aliases are not shown in the usage help.

This behavior is enabled unless explicitly disabled here or using the ParseOptionsAttribute.AutoPrefixAliases property.

If not null, this property overrides the value of the ParseOptionsAttribute.AutoPrefixAliases property.

See Also