summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorOpportunityLiu <[email protected]>2019-06-05 21:15:28 +0800
committerOpportunityLiu <[email protected]>2019-06-05 21:15:28 +0800
commit2fc0ed7ad1d2af134d1b25334634f1050bb42376 (patch)
tree217dd8eab7a5b7aa127da497554f6ca878d9ec9a /scripts
parent1b5017a88667c5af7a4afd4311d4861eb540b1bb (diff)
fix for powershell
Diffstat (limited to 'scripts')
-rw-r--r--scripts/register-completions.ps17
1 files changed, 6 insertions, 1 deletions
diff --git a/scripts/register-completions.ps1 b/scripts/register-completions.ps1
index 58e11320a..6295cf4fc 100644
--- a/scripts/register-completions.ps1
+++ b/scripts/register-completions.ps1
@@ -2,7 +2,12 @@
Register-ArgumentCompleter -Native -CommandName xmake -ScriptBlock {
param($commandName, $wordToComplete, $cursorPosition)
- xmake lua private.utils.complete "$cursorPosition" "$wordToComplete" | ForEach-Object {
+ $complete = "$wordToComplete"
+ if (-not $commandName) {
+ $complete = $complete + " "
+ }
+ xmake lua private.utils.complete "0" "$complete" | ForEach-Object {
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_)
}
}
+