diff --git a/etc/bash_completion.d/ee b/etc/bash_completion.d/ee index 4d9c7230..15511c69 100644 --- a/etc/bash_completion.d/ee +++ b/etc/bash_completion.d/ee @@ -10,8 +10,8 @@ EEAUTO() # Get Previous Word local PREVIOUS=${COMP_WORDS[COMP_CWORD-1]} - # Use All Word Twice - local EEALL=${COMP_WORDS[COMP_CWORD-2]} + # Use Word Twice In Auto Completion + local EECOMMON=${COMP_WORDS[COMP_CWORD-2]} # List Of Suggested Words case "$PREVIOUS" in @@ -48,19 +48,27 @@ EEAUTO() return 0 ;; - show|info|enable|db|files) + show|enable|db|files) COMPREPLY=( $( compgen -W '$(command find /etc/nginx/sites-available/ -type f -printf "%P " 2>/dev/null)' -- $CURRENT ) ) return 0 ;; all) - if [ "$EEALL" = "delete" ] + if [ "$EECOMMON" = "delete" ] then COMPREPLY=( $( compgen -W '$(command find /etc/nginx/sites-available/ -type f -printf "%P " 2>/dev/null)' -- $CURRENT ) ) fi return 0 ;; + info) + if [ "$EECOMMON" = "site" ] + then + COMPREPLY=( $( compgen -W '$(command find /etc/nginx/sites-available/ -type f -printf "%P " 2>/dev/null)' -- $CURRENT ) ) + fi + return 0 + ;; + disable) COMPREPLY=( $( compgen -W '$(command find /etc/nginx/sites-enabled/ -type l -printf "%P " 2>/dev/null)' -- $CURRENT ) ) return 0