1
0
Fork 0
mirror of https://github.com/spf13/cobra synced 2025-04-07 23:39:12 +00:00
This commit is contained in:
Casey Barton 2025-03-14 18:07:24 -04:00 committed by GitHub
commit edae5e9c54
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -304,7 +304,12 @@ filter __%[1]s_escapeStringWithSpecialChars {
}
}
Register-ArgumentCompleter -CommandName '%[1]s' -ScriptBlock ${__%[2]sCompleterBlock}
# Register the completer for the command and for all aliases of the command
'%[1]s', (Get-Alias -Definition '%[1]s' -ErrorAction Ignore).Name | ForEach-Object {
if ($_) {
Register-ArgumentCompleter -CommandName $_ -ScriptBlock ${__%[2]sCompleterBlock}
}
}
`, name, nameForVar, compCmd,
ShellCompDirectiveError, ShellCompDirectiveNoSpace, ShellCompDirectiveNoFileComp,
ShellCompDirectiveFilterFileExt, ShellCompDirectiveFilterDirs, ShellCompDirectiveKeepOrder, activeHelpEnvVar(name)))