From 7db1680edde374b7de32daeb32e8b801979e2786 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Sat, 5 Jan 2013 21:48:36 -0500 Subject: bash-completion: detect devtype via -t --- bash-completion | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'bash-completion') diff --git a/bash-completion b/bash-completion index 2bcce1d..b9388c4 100644 --- a/bash-completion +++ b/bash-completion @@ -29,7 +29,7 @@ _ponymix() { fi case $word in - --devtype) + --devtype|-t) # look ahead to next word if [[ ${COMP_WORDS[i+1]} ]]; then devtype=${COMP_WORDS[i+1]} @@ -38,6 +38,9 @@ _ponymix() { --devtype=*) devtype=${word#--devtype=} ;; + -t*) + devtype=${word#-t} + ;; --sink|--output) devtype=sink ;; @@ -53,9 +56,9 @@ _ponymix() { case $prev in --card|-c) - mapfile -t devices < <(\ponymix list-cards-short 2>/dev/null) + mapfile -t cards < <(\ponymix list-cards-short 2>/dev/null) local IFS=$'\n' - COMPREPLY=($(compgen -W '$(printf "%s\n" "${devices[@]//\ /\\ }")' -- "$cur")) + COMPREPLY=($(compgen -W '$(printf "%s\n" "${cards[@]//\ /\\ }")' -- "$cur")) ;; --device|-d) while IFS=$'\t' read _ dev idx _; do -- cgit v1.2.3