public CommandInfo? GetCommand(
string commandName
)
Public Function GetCommand (
commandName As String
) As CommandInfo
Dim instance As CommandManager
Dim commandName As String
Dim returnValue As CommandInfo
returnValue = instance.GetCommand(commandName)
public:
CommandInfo^ GetCommand(
String^ commandName
)
The command is located by searching all types in the assemblies for a command type whose command name or alias matches the specified name. If there are multiple commands with the same name, the first matching one will be returned.
If the CommandOptionsAutoCommandPrefixAliases property is , this function will also return a command whose name or alias starts with commandName. In this case, the command will only be returned if there is exactly one matching command; if the prefix is ambiguous, is returned.
A command's name is taken from the CommandAttributeCommandName property. If that property is , the name is determined by taking the command type's name, and applying the transformation specified by the CommandOptionsCommandNameTransform property. A command's aliases are specified using the AliasAttribute attribute.
Commands that don't meet the criteria of the CommandOptionsCommandFilter predicate are not returned.
If the CommandOptionsParentCommand property is , only commands without a ParentCommandAttribute attribute are returned. If it is not , only commands where the type specified using the ParentCommandAttribute attribute matches the value of the property are returned.
The automatic version command is returned if the CommandOptionsAutoVersionCommand property is and commandName matches the name of the automatic version command, and not any other command name. The CommandOptionsCommandFilter and CommandOptionsParentCommand property also affect whether the version command is returned.
ArgumentNullException | commandName is . |