mirror of
https://github.com/spf13/cobra
synced 2024-11-24 22:57:12 +00:00
Forgot about the original alias!
In my exuberance to include all the other aliases, I accidentally removed the original alias that was previously the only one being registered for autocompletion. I have restored this `'%[1]s'`.
This commit is contained in:
parent
a6a563d656
commit
cc6f7e0edd
1 changed files with 2 additions and 2 deletions
|
@ -281,13 +281,13 @@ filter __%[1]s_escapeStringWithSpecialChars {
|
||||||
# Enumerate the cmds for %[1]s (set by System.Environment)
|
# Enumerate the cmds for %[1]s (set by System.Environment)
|
||||||
$available%[2]s = Get-Command -Name '%[1]s' -All -ErrorAction SilentlyContinue
|
$available%[2]s = Get-Command -Name '%[1]s' -All -ErrorAction SilentlyContinue
|
||||||
|
|
||||||
# Enumerate set aliases for %[1]s (set by user)
|
# Enumerate extant aliases for %[1]s (already set by user)
|
||||||
$__%[2]sAliases = @()
|
$__%[2]sAliases = @()
|
||||||
foreach($__%[2]sCmd in $available%[2]s){
|
foreach($__%[2]sCmd in $available%[2]s){
|
||||||
$__%[2]sAliases += Get-Alias | Where-Object { $_.Definition -eq ($__%[2]sCmd | Resolve-Path) }
|
$__%[2]sAliases += Get-Alias | Where-Object { $_.Definition -eq ($__%[2]sCmd | Resolve-Path) }
|
||||||
}
|
}
|
||||||
# Register args completer for all cmds and aliases
|
# Register args completer for all cmds and aliases
|
||||||
Register-ArgumentCompleter -CommandName ([array]$available%[2]s.Name + [array]$__%[2]sAliases.Name) -ScriptBlock $__%[2]sCompleterBlock
|
Register-ArgumentCompleter -CommandName ([array]$available%[2]s.Name + [array]$__%[2]sAliases.Name + @('%[1]s')) -ScriptBlock $__%[2]sCompleterBlock
|
||||||
`, name, nameForVar, compCmd,
|
`, name, nameForVar, compCmd,
|
||||||
ShellCompDirectiveError, ShellCompDirectiveNoSpace, ShellCompDirectiveNoFileComp,
|
ShellCompDirectiveError, ShellCompDirectiveNoSpace, ShellCompDirectiveNoFileComp,
|
||||||
ShellCompDirectiveFilterFileExt, ShellCompDirectiveFilterDirs, ShellCompDirectiveKeepOrder, activeHelpEnvVar(name)))
|
ShellCompDirectiveFilterFileExt, ShellCompDirectiveFilterDirs, ShellCompDirectiveKeepOrder, activeHelpEnvVar(name)))
|
||||||
|
|
Loading…
Reference in a new issue