diff --git a/etc/bash_completion.d/ee b/etc/bash_completion.d/ee index 18cd59a5..8cf11f8f 100644 --- a/etc/bash_completion.d/ee +++ b/etc/bash_completion.d/ee @@ -10,6 +10,9 @@ EEAUTO() # Get Previous Word local PREVIOUS=${COMP_WORDS[COMP_CWORD-1]} + # Use All Word Twice + local EEALL=${COMP_WORDS[COMP_CWORD-2]} + # List Of Suggested Words case "$PREVIOUS" in @@ -45,11 +48,19 @@ EEAUTO() return 0 ;; - show|info|enable|db|files|all) + show|info|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" ] + 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