[med-svn] [bart] 01/01: really add bart_completion.sh

Martin Uecker uecker-guest at moszumanska.debian.org
Sun Dec 27 07:23:10 UTC 2015


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

uecker-guest pushed a commit to branch master
in repository bart.

commit 94ced94d0a3213ef85da6ea642e0f37c6c0bcf58
Author: Martin Uecker <muecker at gwdg.de>
Date:   Sun Dec 27 00:04:07 2015 +0100

    really add bart_completion.sh
---
 debian/bart_completion.sh | 43 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)

diff --git a/debian/bart_completion.sh b/debian/bart_completion.sh
new file mode 100644
index 0000000..4dcd007
--- /dev/null
+++ b/debian/bart_completion.sh
@@ -0,0 +1,43 @@
+# bart parameter-completion
+
+
+
+function _bart()
+{
+	local cur=${COMP_WORDS[$COMP_CWORD]}
+
+	if [ $COMP_CWORD -eq 1 ] ; then
+
+		local CMDS=$(bart | tail -n +2)
+		COMPREPLY=($(compgen -W "$CMDS" -- "$cur"));
+
+	else
+
+		local bcmd=${COMP_WORDS[1]}
+
+		case $cur in
+		-*)
+			COMPREPLY=($(bart ${bcmd} -h | grep -o -E "^${cur}\w*"))
+			;;
+		*)
+			case $bcmd in
+			twixread)
+				COMPREPLY=($(compgen -o plusdirs -f -X '!*.dat' -- ${cur}))
+				;;
+			*)
+				local CFLS=$(compgen -o plusdirs -f -X '!*.hdr' -- ${cur})
+				local COOS=$(compgen -o plusdirs -f -X '!*.coo' -- ${cur});
+				local suffix=".hdr"
+				COMPREPLY=($(for i in ${CFLS} ${COOS}; do echo ${i%$suffix} ; done))
+				;;
+			esac
+
+			;;
+		esac
+	fi
+
+	return 0
+}
+
+complete -o filenames -F _bart bart ./bart
+

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



More information about the debian-med-commit mailing list