Browse Source

corrected autocompletion for log command

bugfixes
harshadyeola 10 years ago
parent
commit
170e794b2b
  1. 28
      config/bash_completion.d/ee_auto.rc

28
config/bash_completion.d/ee_auto.rc

@ -94,12 +94,18 @@ _ee_complete()
;; ;;
"edit" | "enable" | "info" | "log" | "show" | "cd" | "update" | "delete") "edit" | "enable" | "info" | "log" | "show" | "cd" | "update" | "delete")
COMPREPLY=( $(compgen \ if [ ${COMP_WORDS[1]} == "log" ]; then
-W "$(find /etc/nginx/sites-available/ -type f -printf "%P " 2> /dev/null)" \ COMPREPLY=( $(compgen \
-- $cur) ) -W "$(find /etc/nginx/sites-available/ -type f -printf "%P " 2> /dev/null) --nginx --php --fpm --mysql --wp --access" \
-- $cur) )
else
COMPREPLY=( $(compgen \
-W "$(find /etc/nginx/sites-available/ -type f -printf "%P " 2> /dev/null)" \
-- $cur) )
fi
;; ;;
"show" | "gzip" | "email") "gzip" | "email")
COMPREPLY=( $(compgen \ COMPREPLY=( $(compgen \
-W "$(find /etc/nginx/sites-available/ -type f -printf "%P " 2> /dev/null) --nginx --php --fpm --mysql --wp --access" \ -W "$(find /etc/nginx/sites-available/ -type f -printf "%P " 2> /dev/null) --nginx --php --fpm --mysql --wp --access" \
-- $cur) ) -- $cur) )
@ -129,13 +135,13 @@ _ee_complete()
-- $cur) ) -- $cur) )
fi fi
if [ ${COMP_WORDS[1]} == "log" ] && ([ "$prev" != "--access" ] || [ "$prev" != "--nginx" ] || [ "$prev" != "--php" ] || [ "$prev" != "--fpm" ] || [ "$prev" != "--mysql" ] || [ "$prev" != "-i" ] || ["$prev" != "--interactive" ] || ["$prev" != "--stop" ]); then #if [ ${COMP_WORDS[1]} == "log" ] && ([ "$prev" != "--access" ] || [ "$prev" != "--nginx" ] || [ "$prev" != "--php" ] || [ "$prev" != "--fpm" ] || [ "$prev" != "--mysql" ] || [ "$prev" != "-i" ] || ["$prev" != "--interactive" ] || ["$prev" != "--stop" ]); then
retlist="--all --wp --rewrite -i --all=off --wp=off --rewrite=off" # retlist="--all --wp --rewrite -i --all=off --wp=off --rewrite=off"
ret="${retlist[@]/$prev}" # ret="${retlist[@]/$prev}"
COMPREPLY=( $(compgen \ # COMPREPLY=( $(compgen \
-W "$(echo $ret)" \ # -W "$(echo $ret)" \
-- $cur) ) # -- $cur) )
fi #fi
elif [ $COMP_CWORD -eq 4 ]; then elif [ $COMP_CWORD -eq 4 ]; then

Loading…
Cancel
Save