summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorruki <[email protected]>2020-01-17 22:15:32 +0800
committerGitHub <[email protected]>2020-01-17 22:15:32 +0800
commita859e101ee88ec25fd948a08d2a02e7621241e7f (patch)
treeb6558e583ac20627222139a28f2c9c87c3af3c19 /scripts
parentffce1ede94e7873e7ab248b05d468e84f6c205d0 (diff)
parentdc25ac7a87256a0470f523017ee790b29e9b6f2d (diff)
Merge pull request #667 from OpportunityLiu/options
Improve to parse command line options
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/get.sh4
-rw-r--r--scripts/register-completions.bash2
-rw-r--r--scripts/register-completions.ps12
-rw-r--r--scripts/register-completions.zsh2
4 files changed, 5 insertions, 5 deletions
diff --git a/scripts/get.sh b/scripts/get.sh
index c57f3bf4f..a0d49c528 100755
--- a/scripts/get.sh
+++ b/scripts/get.sh
@@ -170,7 +170,7 @@ if [[ "$SHELL" = */zsh ]]; then
_xmake_zsh_complete()
{
- local completions=("$(XMAKE_SKIP_HISTORY=1 xmake lua private.utils.complete 0 nospace "$words")")
+ local completions=("$(XMAKE_SKIP_HISTORY=1 xmake lua --root private.utils.complete 0 nospace "$words")")
reply=( "${(ps:\n:)completions}" )
}
@@ -185,7 +185,7 @@ elif [[ "$SHELL" = */bash ]]; then
local word=${COMP_WORDS[COMP_CWORD]}
local completions
- completions="$(XMAKE_SKIP_HISTORY=1 xmake lua private.utils.complete "${COMP_POINT}" "${COMP_LINE}" 2>/dev/null)"
+ completions="$(XMAKE_SKIP_HISTORY=1 xmake lua --root private.utils.complete "${COMP_POINT}" "conf" "${COMP_LINE}" 2>/dev/null)"
if [ $? -ne 0 ]; then
completions=""
fi
diff --git a/scripts/register-completions.bash b/scripts/register-completions.bash
index 9d5865cd6..18df8a3b7 100644
--- a/scripts/register-completions.bash
+++ b/scripts/register-completions.bash
@@ -5,7 +5,7 @@ _xmake_bash_complete()
local word=${COMP_WORDS[COMP_CWORD]}
local completions
- completions="$(XMAKE_SKIP_HISTORY=1 xmake lua private.utils.complete "${COMP_POINT}" "${COMP_LINE}" 2>/dev/null)"
+ completions="$(XMAKE_SKIP_HISTORY=1 xmake lua --root private.utils.complete "${COMP_POINT}" "conf" "${COMP_LINE}" 2>/dev/null)"
if [ $? -ne 0 ]; then
completions=""
fi
diff --git a/scripts/register-completions.ps1 b/scripts/register-completions.ps1
index bae3281f8..a9ecd7877 100644
--- a/scripts/register-completions.ps1
+++ b/scripts/register-completions.ps1
@@ -8,7 +8,7 @@ Register-ArgumentCompleter -Native -CommandName xmake -ScriptBlock {
}
$oldenv = $env:XMAKE_SKIP_HISTORY
$env:XMAKE_SKIP_HISTORY = 1
- xmake lua private.utils.complete "0" "$complete" | ForEach-Object {
+ xmake lua --root private.utils.complete "0" "nospace" "$complete" | ForEach-Object {
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_)
}
$env:XMAKE_SKIP_HISTORY = $oldenv
diff --git a/scripts/register-completions.zsh b/scripts/register-completions.zsh
index 82f588d5f..5c16cf334 100644
--- a/scripts/register-completions.zsh
+++ b/scripts/register-completions.zsh
@@ -2,7 +2,7 @@
_xmake_zsh_complete()
{
- local completions=("$(XMAKE_SKIP_HISTORY=1 xmake lua private.utils.complete 0 nospace "$words")")
+ local completions=("$(XMAKE_SKIP_HISTORY=1 xmake lua --root private.utils.complete 0 nospace "$words")")
reply=( "${(ps:\n:)completions}" )
}