misc:completion:be.bash: use tabs to indent shell script.
authorW. Trevor King <wking@tremily.us>
Mon, 3 Sep 2012 12:08:20 +0000 (08:08 -0400)
committerW. Trevor King <wking@tremily.us>
Mon, 3 Sep 2012 12:08:20 +0000 (08:08 -0400)
misc/completion/be.bash [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index 1d3a941..853ec31
 #       to print a list of available completions at that point
 _be()
 {
-    local cur prev opts
-    COMPREPLY=()
-    cur="${COMP_WORDS[COMP_CWORD]}"
-    prev="${COMP_WORDS[COMP_CWORD-1]}"
-    
-    if [ $COMP_CWORD -eq 1 ]; then
-       # no command yet, show all commands
-       COMPREPLY=( $( compgen -W "$(be --complete)" -- $cur ) )
-    else
-       # remove the first word (should be "be") for security reasons
-       unset COMP_WORDS[0]
-       # remove the current word and all later words, because they
-       # are not needed for completion.
-       for i in `seq $COMP_CWORD ${#COMP_WORDS[@]}`; do
-           unset COMP_WORDS[$i];
-       done
-       COMPREPLY=( $( IFS=$'\n' compgen -W "$(be "${COMP_WORDS[@]}" --complete $cur)" -- $cur ) )
-    fi
+       local cur prev opts
+       COMPREPLY=()
+       cur="${COMP_WORDS[COMP_CWORD]}"
+       prev="${COMP_WORDS[COMP_CWORD-1]}"
+
+       if [ $COMP_CWORD -eq 1 ]; then
+               # no command yet, show all commands
+               COMPREPLY=( $( compgen -W "$(be --complete)" -- $cur ) )
+       else
+               # remove the first word (should be "be") for security reasons
+               unset COMP_WORDS[0]
+               # remove the current word and all later words, because they
+               # are not needed for completion.
+               for i in `seq $COMP_CWORD ${#COMP_WORDS[@]}`; do
+                       unset COMP_WORDS[$i];
+               done
+               COMPREPLY=( $( IFS=$'\n' compgen -W "$(be "${COMP_WORDS[@]}" --complete $cur)" -- $cur ) )
+       fi
 }
 
 complete -F _be be