summaryrefslogtreecommitdiff
path: root/scripts/register-completions.ps1
blob: 6295cf4fcaf2d1966cf63255e7e9b65725b58264 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
# PowerShell parameter completion shim for xmake

Register-ArgumentCompleter -Native -CommandName xmake -ScriptBlock {
    param($commandName, $wordToComplete, $cursorPosition)
    $complete = "$wordToComplete"
    if (-not $commandName) {
        $complete = $complete + " "
    }
    xmake lua private.utils.complete "0" "$complete" | ForEach-Object {
        [System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_)
    }
}