Merge pull request #1139 from kirinnee/master
Added manual and script for PowerShell autocompletemain
commit
3629eb8550
@ -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', $_)
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in new issue