summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorOpportunityLiu <[email protected]>2019-08-30 15:40:31 +0800
committerOpportunityLiu <[email protected]>2019-08-30 15:42:58 +0800
commit6d1a2327b13b6bff9d94715dceedaf4a4651c968 (patch)
tree6a62f98cfaf115bdbc68bfd3104342d166d40940 /scripts
parent00709d887ac44a69eecda7259bb4e119d74470aa (diff)
add XMAKE_SKIP_HISTORY
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/get.sh4
-rw-r--r--scripts/register-completions.bash2
-rw-r--r--scripts/register-completions.ps13
-rw-r--r--scripts/register-completions.zsh2
4 files changed, 7 insertions, 4 deletions
diff --git a/scripts/get.sh b/scripts/get.sh
index 5ae3f8513..7616a3dd1 100755
--- a/scripts/get.sh
+++ b/scripts/get.sh
@@ -169,7 +169,7 @@ if [[ "$SHELL" = */zsh ]]; then
_xmake_zsh_complete()
{
- local completions=("$(xmake lua private.utils.complete 0 nospace "$words")")
+ local completions=("$(XMAKE_SKIP_HISTORY=1 xmake lua private.utils.complete 0 nospace "$words")")
reply=( "${(ps:\n:)completions}" )
}
@@ -184,7 +184,7 @@ elif [[ "$SHELL" = */bash ]]; then
local word=${COMP_WORDS[COMP_CWORD]}
local completions
- completions="$(xmake lua private.utils.complete "${COMP_POINT}" "${COMP_LINE}" 2>/dev/null)"
+ completions="$(XMAKE_SKIP_HISTORY=1 xmake lua private.utils.complete "${COMP_POINT}" "${COMP_LINE}" 2>/dev/null)"
if [ $? -ne 0 ]; then
completions=""
fi
diff --git a/scripts/register-completions.bash b/scripts/register-completions.bash
index 64655760d..9d5865cd6 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 lua private.utils.complete "${COMP_POINT}" "${COMP_LINE}" 2>/dev/null)"
+ completions="$(XMAKE_SKIP_HISTORY=1 xmake lua private.utils.complete "${COMP_POINT}" "${COMP_LINE}" 2>/dev/null)"
if [ $? -ne 0 ]; then
completions=""
fi
diff --git a/scripts/register-completions.ps1 b/scripts/register-completions.ps1
index 6295cf4fc..b58b07cf9 100644
--- a/scripts/register-completions.ps1
+++ b/scripts/register-completions.ps1
@@ -6,8 +6,11 @@ Register-ArgumentCompleter -Native -CommandName xmake -ScriptBlock {
if (-not $commandName) {
$complete = $complete + " "
}
+ $oldenv = $env:XMAKE_SKIP_HISTORY
+ $env:XMAKE_SKIP_HISTORY = 1
xmake lua private.utils.complete "0" "$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 509816e56..82f588d5f 100644
--- a/scripts/register-completions.zsh
+++ b/scripts/register-completions.zsh
@@ -2,7 +2,7 @@
_xmake_zsh_complete()
{
- local completions=("$(xmake lua private.utils.complete 0 nospace "$words")")
+ local completions=("$(XMAKE_SKIP_HISTORY=1 xmake lua private.utils.complete 0 nospace "$words")")
reply=( "${(ps:\n:)completions}" )
}