decentral1se b313b0a145
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
fix: use old auto-completion for 0.9.x compat
See toolshed/organising#644

Partial revert of 1f8662cd9518c3d1e14d058f2a88d438b59170b2
2024-10-27 08:54:43 +01:00

10 lines
427 B
Plaintext

$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', $_)
}
}