[Bash-completion-commits] [bash-completion] 03/04: wtf: Look for acronym db from /usr/share/games/bsdgames/acronyms too.

Ville Skyttä scop-guest at moszumanska.debian.org
Tue Nov 26 17:52:50 UTC 2013


This is an automated email from the git hooks/post-receive script.

scop-guest pushed a commit to branch master
in repository bash-completion.

commit 920bbb8582bcd3039ff4e4388e795e3144eb30b6
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Tue Nov 26 19:45:02 2013 +0200

    wtf: Look for acronym db from /usr/share/games/bsdgames/acronyms too.
    
    Submitted-by: Raphaël Droz (modified)
    http://lists.alioth.debian.org/pipermail/bash-completion-devel/2013-November/004991.html
---
 completions/wtf | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/completions/wtf b/completions/wtf
index 651d687..6491f4c 100644
--- a/completions/wtf
+++ b/completions/wtf
@@ -22,9 +22,17 @@ _wtf()
         fi
         shift
     done
-    [[ -z $db ]] && db=${ACRONYMDB:-/usr/share/misc/acronyms*}
 
-    COMPREPLY=( $( compgen -W "$( cut -f 1 -s $db 2>/dev/null ) $addf" \
+    if [[ -z "$db" ]]; then
+        local f
+        for f in "$ACRONYMDB" /usr/share/misc/acronyms \
+            /usr/share/games/bsdgames/acronyms; do
+            [[ -f "$f" ]] && db="$f" && break
+        done
+        [[ -z "$db" ]] && return 0
+    fi
+
+    COMPREPLY=( $( compgen -W "$( cut -f 1 -s $db* 2>/dev/null ) $addf" \
         -- "${cur^^}" ) )
 } &&
 complete -F _wtf wtf

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/bash-completion/bash-completion.git



More information about the Bash-completion-commits mailing list