summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorOpportunityLiu <[email protected]>2020-01-21 19:30:02 +0800
committerOpportunityLiu <[email protected]>2020-01-21 19:30:02 +0800
commit19e11d5150fd2496a74f2e461673698e591be008 (patch)
tree5630de74f6ce520740bdc370432bef142a4ccdde /scripts
parent504f92e23ac9d6615879ec3037c50d24cccd7bd0 (diff)
fix bash complete
Diffstat (limited to 'scripts')
-rw-r--r--scripts/register-completions.sh8
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/register-completions.sh b/scripts/register-completions.sh
index 9b00e715b..e274605b2 100644
--- a/scripts/register-completions.sh
+++ b/scripts/register-completions.sh
@@ -5,21 +5,21 @@ if [[ "$SHELL" = */zsh ]]; then
# zsh parameter completion for xmake
_xmake_zsh_complete()
{
- local completions=("$(XMAKE_SKIP_HISTORY=1 xmake lua --root private.utils.complete 0 nospace "$words")")
+ local completions=("$(XMAKE_SKIP_HISTORY=1 XMAKE_ROOT=y xmake lua private.utils.complete 0 nospace "$words")")
reply=( "${(ps:\n:)completions}" )
}
compctl -f -S "" -K _xmake_zsh_complete xmake
elif [[ "$SHELL" = */bash ]]; then
- # bash parameter completion for xmake
+ # bash parameter completion for xmake
_xmake_bash_complete()
{
local word=${COMP_WORDS[COMP_CWORD]}
local completions
- completions="$(XMAKE_SKIP_HISTORY=1 xmake lua --root private.utils.complete "${COMP_POINT}" "nospace-nokey" "${COMP_LINE}" 2>/dev/null)"
+ completions="$(XMAKE_SKIP_HISTORY=1 XMAKE_ROOT=y xmake lua private.utils.complete "${COMP_POINT}" "nospace-nokey" "${COMP_LINE}")"
if [ $? -ne 0 ]; then
completions=""
fi
- COMPREPLY=( $(compgen -W "$completions" -- "$word") )
+ COMPREPLY=( $(compgen -W "$completions") )
}
complete -o default -o nospace -F _xmake_bash_complete xmake
fi