File: autocomplete.ps1

package info (click to toggle)
tea-cli 0.9.2-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,364 kB
  • sloc: makefile: 120; sh: 17
file content (9 lines) | stat: -rw-r--r-- 426 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
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', $_)
         }
 }