From 96151bd07330aee400fb99fd9f8f117bae42c9e5 Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 30 Dec 2013 03:03:22 +0100 Subject: bridge -> Cancer/\1 --- Cancer/bridge/etc/bash_completion.d/bridge | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 Cancer/bridge/etc/bash_completion.d/bridge (limited to 'Cancer/bridge/etc') diff --git a/Cancer/bridge/etc/bash_completion.d/bridge b/Cancer/bridge/etc/bash_completion.d/bridge new file mode 100644 index 00000000..86d8a4e2 --- /dev/null +++ b/Cancer/bridge/etc/bash_completion.d/bridge @@ -0,0 +1,18 @@ +#! /bin/bash +function comp_bridge() { + local cword="${COMP_WORDS[$COMP_CWORD]}" + local bindir="$(dirname $(readlink -f "$BASH_SOURCE"))/../../lib/bridge/bin" + case $COMP_CWORD in + (1) + COMPREPLY=( $(cd "$bindir" && ls | grep "^$cword.*") ) + ;; + (2) + case "${COMP_WORDS[1]}" in + (attach|destroy|paste) + COMPREPLY=( $(bridge list 2>/dev/null | grep "^$cword.*") ) + ;; + esac + ;; + esac +} +complete -F comp_bridge bridge -- cgit v1.2.3