public (CommandInfo Command, ImmutableArray<string?> PossibleMatches) GetCommandOrPossibleMatches(
string commandName
)
Public Function GetCommandOrPossibleMatches (
commandName As String
) As (Command As CommandInfo, PossibleMatches As ImmutableArray(Of String))
Dim instance As CommandManager
Dim commandName As String
Dim returnValue As (Command As CommandInfo, PossibleMatches As ImmutableArray(Of String))
returnValue = instance.GetCommandOrPossibleMatches(commandName)
public:
ValueTuple<CommandInfo^, ImmutableArray<String^>> GetCommandOrPossibleMatches(
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, no command is returned, but a list of possible matching command names or aliases is returned instead.
If the returned command is not , the list of possible matches will always be empty.
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 . |