public abstract class CliCommandBuilder
CliCommandBuilder | Initializes a new instance of the CliCommandBuilder class. |
ChildDefinitionTypes | The child definition classes if this command builder is generated for an external parent. |
Children | Gets the command builders that are nested/external children of this command builder. |
DefinitionType | The definition class that this command builder is generated for. |
IsRoot | Gets a value which indicates whether this command builder is for a root command. |
NameCasingConvention | Gets the character casing convention used for automatically generated command, option and argument names. |
NamePrefixConvention | Gets the prefix convention used for automatically generated option names. |
ParentDefinitionType | The parent definition class if this command builder is generated for a nested/external child. |
Parents | Gets the command builders that are nested/external parents of this command builder. |
ShortFormAutoGenerate | Gets a value which indicates whether short form aliases were automatically generated for options. |
ShortFormPrefixConvention | Gets the prefix convention used for automatically generated short form option aliases. |
AddAlias(Command, String) | Adds an alias to a command. Tracks used aliases and only adds if not already used. |
AddAlias(Option, String) | Adds an alias to an option. Tracks used aliases and only adds if not already used. |
AddShortFormAlias | Adds a short form alias for an option name for a property by using current ShortFormAutoGenerate and ShortFormPrefixConvention. Short form alias is added only when current ShortFormAutoGenerate is and option name without prefix is longer than 1 character. |
Bind |
Creates a new instance of the command definition class and binds/populates the properties from the parse result.
Note that binding will be done only once, so calling this method consecutively will return the cached result.
If the command line input is not for this definition class (e.g. it's for a sub-command but not for this root command or vice versa), then the returned instance would be empty (i.e. properties would have default values). |
Build | Builds a Command instance, populated with sub-commands, options, arguments and settings. |
Get(Type) | Gets the command builder registered for the definition class. |
GetTDefinition | Gets the command builder registered for the definition class. |
GetArgumentName | Gets the argument name for a property by using current NameCasingConvention. |
GetArgumentParserTArgument(FuncString, TArgument) |
Gets an argument parser method for an argument type.
This is mainly used for adding support for binding custom types which have a public constructor or a static Parse method with a string parameter (other parameters, if any, should be optional). |
GetArgumentParserTCollection, TItem(FuncArray, TCollection, FuncString, TItem) |
Gets an argument parser method for an argument type, if it's a collection type.
This is mainly used for adding support for all IEnumerableT compatible types which have a public constructor with a IEnumerableT or IListT parameter (other parameters, if any, should be optional). |
GetChildren(Type) | Gets the command builders that are registered as nested/external children of a parent definition. |
GetChildrenTParentDefinition | Gets the command builders that are registered as nested/external children of a parent definition. |
GetCommandName | Gets the command name for a property by using current NameCasingConvention. |
GetOptionName | Gets the option name for a property by using current NameCasingConvention and NamePrefixConvention. |
GetParents(Type) | Gets the command builders that are registered as nested/external parents of a child definition. |
GetParentsTDefinition | Gets the command builders that are registered as nested/external parents of a child definition. |
GetValueForArgument(ParseResult, Argument) |
Gets the parsed or default value for the specified argument.
Extended version for DotMake CLI which can bind custom classes, does not fall back to internal ArgumentConverter.GetDefaultValue which does not support all IList compatible types. |
GetValueForArgumentT(ParseResult, ArgumentT) |
Gets the parsed or default value for the specified argument.
Extended version for DotMake CLI which can bind custom classes, does not fall back to internal ArgumentConverter.GetDefaultValue which does not support all IList compatible types. |
GetValueForOption(ParseResult, Option) |
Gets the parsed or default value for the specified option.
Extended version for DotMake CLI which can bind custom classes, does not fall back to internal ArgumentConverter.GetDefaultValue which does not support all IList compatible types. |
GetValueForOptionT(ParseResult, OptionT) |
Gets the parsed or default value for the specified option.
Extended version for DotMake CLI which can bind custom classes, does not fall back to internal ArgumentConverter.GetDefaultValue which does not support all IList compatible types. |
InheritSettings | Inherits settings from a parent command builder. If a setting is not null in this command builder, then that will be used instead. |
Register | Registers this command builder so that it can be found by the definition class, and it can be found by the parent definition class if it's a nested/external child. |
Register(Type, CliCommandBuilder) | Registers a command builder so that it can be found by the definition class. |
RegisterTDefinition(CliCommandBuilder) | Registers a command builder so that it can be found by the definition class. |
RegisterAsChild(Type, Type) | Registers a command builder as a nested/external child so that it can be found by the parent definition class. |
RegisterAsChildTParentDefinition, TChildDefinition | Registers a command builder as a nested/external child so that it can be found by the parent definition class. |
Binder | A delegate which is set by the source generator to be called from Bind(ParseResult) method. |
ServiceProvider | The service provider if it is used. This will be disposed at the end of the execution. |