mirror of
https://gitea.com/gitea/tea.git
synced 2024-11-03 04:27:21 -05:00
9 lines
426 B
PowerShell
9 lines
426 B
PowerShell
|
$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', $_)
|
||
|
}
|
||
|
}
|