You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
9 lines
426 B
9 lines
426 B
$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', $_) |
|
} |
|
} |