0
0
forked from toolshed/abra

refactor: shorter names for autocomplete files

This commit is contained in:
2021-09-10 23:44:32 +02:00
parent 99160967a8
commit bc5fc0b0cb
4 changed files with 7 additions and 4 deletions

9
autocomplete/powershell Normal file
View File

@ -0,0 +1,9 @@
$fn = $($MyInvocation.MyCommand.Name)
$name = $fn -replace "(.*)\.ps1$", '$1'
Register-ArgumentCompleter -Native -CommandName $name -ScriptBlock {
param($commandName, $wordToComplete, $cursorPosition)
$other = "$wordToComplete --generate-bash-completion"
Invoke-Expression $other | ForEach-Object {
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_)
}
}