ParseOptionsAttribute.AutoVersionArgument Property

Gets or sets a value that indicates a version argument will be automatically added.

Definition

Namespace: Ookii.CommandLine
Assembly: Ookii.CommandLine (in Ookii.CommandLine.dll) Version: 4.1.0+9df03b6173b5fc9d44dc39638758964dd7a0f4c7
C#
public bool AutoVersionArgument { get; set; }

Property Value

Boolean
true to automatically create a version argument; otherwise, false. The default value is true.

Remarks

If this property is true, the CommandLineParser will automatically add an argument with the name "Version". When supplied, this argument will write version information to the console and cancel parsing, without showing usage help.

If you already have an argument named "Version", the automatic version argument will not be created even if this property is true.

  Note

The automatic version argument will never be created for subcommands.

The name and description can be customized by using a custom LocalizedStringProvider class.

This value can be overridden by the ParseOptions.AutoVersionArgument property.

See Also