summaryrefslogtreecommitdiff
path: root/xmake/scripts/profile-win.ps1
blob: 493543040ff4f46a8093445ce346915f12f8b3db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# PowerShell parameter completion for xmake
Register-ArgumentCompleter -Native -CommandName xmake -ScriptBlock {
    param($commandName, $wordToComplete, $cursorPosition)
    $complete = "$wordToComplete"
    if (-not $commandName) {
        $complete = $complete + " "
    }
    $oldenv = $env:XMAKE_SKIP_HISTORY
    $env:XMAKE_SKIP_HISTORY = 1
    xmake lua --root private.utils.complete "0" "nospace" "$complete" | ForEach-Object {
        [System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_)
    }
    $env:XMAKE_SKIP_HISTORY = $oldenv
}