diff options
| author | OpportunityLiu <[email protected]> | 2019-08-30 15:40:31 +0800 |
|---|---|---|
| committer | OpportunityLiu <[email protected]> | 2019-08-30 15:42:58 +0800 |
| commit | 6d1a2327b13b6bff9d94715dceedaf4a4651c968 (patch) | |
| tree | 6a62f98cfaf115bdbc68bfd3104342d166d40940 /scripts | |
| parent | 00709d887ac44a69eecda7259bb4e119d74470aa (diff) | |
add XMAKE_SKIP_HISTORY
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/get.sh | 4 | ||||
| -rw-r--r-- | scripts/register-completions.bash | 2 | ||||
| -rw-r--r-- | scripts/register-completions.ps1 | 3 | ||||
| -rw-r--r-- | scripts/register-completions.zsh | 2 |
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}" ) } |
