summaryrefslogtreecommitdiff
path: root/completions/export
diff options
context:
space:
mode:
Diffstat (limited to 'completions/export')
-rw-r--r--completions/export16
1 files changed, 8 insertions, 8 deletions
diff --git a/completions/export b/completions/export
index 816182f6..8d823614 100644
--- a/completions/export
+++ b/completions/export
@@ -6,7 +6,7 @@ _export()
_init_completion -n = || return
local i action=variable remove=false
- for (( i=1; i < cword; i++ )); do
+ for ((i = 1; i < cword; i++)); do
case ${words[i]} in
-p)
return
@@ -33,10 +33,10 @@ _export()
case $cur in
*=)
- local pval=$(quote "$(eval printf %s \"\$${cur%=}\")")
+ local pval=$(quote "$(eval printf %s \"\$\{${cur%=}-\}\")")
# Complete previous value if it's not empty.
if [[ $pval != \'\' ]]; then
- COMPREPLY=( "$pval" )
+ COMPREPLY=("$pval")
else
cur=${cur#*=}
_filedir
@@ -48,18 +48,18 @@ _export()
;;
*)
if [[ $cword -eq 1 && $cur == -* ]]; then
- COMPREPLY=( $(compgen -W '-p $(_parse_usage "$1")' -- "$cur") )
+ COMPREPLY=($(compgen -W '-p $(_parse_usage "$1")' -- "$cur"))
return
fi
- local suffix
+ local suffix=""
if ! $remove; then
- suffix+==
+ suffix="="
compopt -o nospace
fi
- COMPREPLY=( $(compgen -A $action -S "$suffix" -- "$cur") )
+ COMPREPLY=($(compgen -A $action -S "$suffix" -- "$cur"))
;;
esac
} &&
-complete -F _export export
+ complete -F _export export
# ex: filetype=sh