From f2746218d5630ffeb66884fafb85afaabc8c1f0c Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Fri, 4 Jan 2013 22:15:09 -0500 Subject: offer appropriate device completion for move --- bash-completion | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'bash-completion') diff --git a/bash-completion b/bash-completion index c6040fc..56a8b95 100644 --- a/bash-completion +++ b/bash-completion @@ -83,6 +83,22 @@ _ponymix() { COMPREPLY=($(compgen -W '${verbs[*]}' -- "$cur")) ;; esac + [[ $COMPREPLY ]] && return 0 + + case $verb in + move) + if [[ $devtype = sink?(-input) ]]; then + while IFS=$'\t' read _ dev idx _; do + devices+=("$dev" "$idx") + done < <(\ponymix --sink list-short 2>/dev/null) + elif [[ $devtype = source?(-output) ]]; then + while IFS=$'\t' read _ dev idx _; do + devices+=("$dev" "$idx") + done < <(\ponymix --source list-short 2>/dev/null) + fi + ;; + esac + [[ $devices ]] && COMPREPLY=($(compgen -W '${devices[*]}' -- "$cur")) return 0 } -- cgit v1.2.3