GeneratedArgumentCreate Method

Creates a GeneratedArgument instance.

Definition

Namespace: Ookii.CommandLine.Support
Assembly: Ookii.CommandLine (in Ookii.CommandLine.dll) Version: 4.2.0+a4d3631e4dcc0970081ed435288efdebc1325f83
C#
public static GeneratedArgument Create(
	CommandLineParser parser,
	Type argumentType,
	Type elementTypeWithNullable,
	Type elementType,
	string memberName,
	CommandLineArgumentAttribute attribute,
	ArgumentKind kind,
	ArgumentConverter converter,
	bool allowsNull,
	string defaultValueDescription,
	int? position = null,
	string? defaultKeyDescription = null,
	bool requiredProperty = false,
	Object? alternateDefaultValue = null,
	Type? keyType = null,
	Type? valueType = null,
	MultiValueSeparatorAttribute? multiValueSeparatorAttribute = null,
	DescriptionAttribute? descriptionAttribute = null,
	ValueDescriptionAttribute? valueDescriptionAttribute = null,
	bool allowDuplicateDictionaryKeys = false,
	KeyValueSeparatorAttribute? keyValueSeparatorAttribute = null,
	IEnumerable<AliasAttribute>? aliasAttributes = null,
	IEnumerable<ShortAliasAttribute>? shortAliasAttributes = null,
	IEnumerable<ArgumentValidationAttribute>? validationAttributes = null,
	Action<Object, Object?>? setProperty = null,
	Func<Object, Object?>? getProperty = null,
	Func<Object?, CommandLineParser, CancelMode>? callMethod = null
)

Parameters

parser  CommandLineParser
The CommandLineParser this argument belongs to.
argumentType  Type
The type of the argument.
elementTypeWithNullable  Type
The element type including NullableT.
elementType  Type
The element type excluding NullableT.
memberName  String
The name of the property or method.
attribute  CommandLineArgumentAttribute
The CommandLineArgumentAttribute.
kind  ArgumentKind
The kind of argument.
converter  ArgumentConverter
The ArgumentConverter for the argument's type.
allowsNull  Boolean
Indicates if values are allowed.
defaultValueDescription  String
The value description to use if the ValueDescriptionAttribute attribute is not present. For dictionary arguments, this is the value description for the value of the key/value pair.
position  NullableInt32  (Optional)
The position for positional arguments that use automatic positioning.
defaultKeyDescription  String  (Optional)
The value description to use for the key of a dictionary argument if the ValueDescriptionAttribute attribute is not present.
requiredProperty  Boolean  (Optional)
Indicates if the argument used a C# 11 required property.
alternateDefaultValue  Object  (Optional)
Default value to use if the CommandLineArgumentAttributeDefaultValue property is not set.
keyType  Type  (Optional)
The type of the key of a dictionary argument.
valueType  Type  (Optional)
The type of the value of a dictionary argument.
multiValueSeparatorAttribute  MultiValueSeparatorAttribute  (Optional)
The MultiValueSeparatorAttribute.
descriptionAttribute  DescriptionAttribute  (Optional)
The DescriptionAttribute.
valueDescriptionAttribute  ValueDescriptionAttribute  (Optional)
The ValueDescriptionAttribute.
allowDuplicateDictionaryKeys  Boolean  (Optional)
The AllowDuplicateDictionaryKeysAttribute.
keyValueSeparatorAttribute  KeyValueSeparatorAttribute  (Optional)
The KeyValueSeparatorAttribute.
aliasAttributes  IEnumerableAliasAttribute  (Optional)
A collection of AliasAttribute values.
shortAliasAttributes  IEnumerableShortAliasAttribute  (Optional)
A collection of ShortAliasAttribute values.
validationAttributes  IEnumerableArgumentValidationAttribute  (Optional)
A collection of ArgumentValidationAttribute values.
setProperty  ActionObject, Object  (Optional)
A delegate that sets the value of the property that defined the argument.
getProperty  FuncObject, Object  (Optional)
A delegate that gets the value of the property that defined the argument.
callMethod  FuncObject, CommandLineParser, CancelMode  (Optional)
A delegate that calls the method that defined the argument.

Return Value

GeneratedArgument
A GeneratedArgument instance.

See Also