[Bash-completion-commits] ./current r1272: completion for minicom

Guillaume Rousse guillomovitch at zarb.org
Mon Jan 19 20:52:54 UTC 2009


------------------------------------------------------------
revno: 1272
committer: Guillaume Rousse <guillomovitch at zarb.org>
branch nick: current
timestamp: Mon 2009-01-19 21:52:54 +0100
message:
  completion for minicom
added:
  to_review/minicom
-------------- next part --------------
=== added file 'to_review/minicom'
--- a/to_review/minicom	1970-01-01 00:00:00 +0000
+++ b/to_review/minicom	2009-01-19 20:52:54 +0000
@@ -0,0 +1,39 @@
+# -*- mode: shell-script; sh-basic-offset: 8; indent-tabs-mode: t -*-
+# ex: ts=8 sw=8 noet filetype=sh
+#
+# bash completion for minicom
+
+have minicom &&
+_minicom()
+{
+	local cur prev
+
+	COMPREPLY=()
+	cur=`_get_cword`
+	prev=${COMP_WORDS[COMP_CWORD-1]}
+
+	case $prev in
+		-@(a|c))
+			COMPREPLY=( $( compgen -W 'on off' -- $cur ) )
+			return 0
+			;;
+		-@(S|C))
+			_filedir
+			return 0
+			;;
+		-P)
+			COMPREPLY=( $( command ls /dev/tty* ) )
+			COMPREPLY=( $( compgen -W '${COMPREPLY[@]} ${COMPREPLY[@]#/dev/}' -- $cur ) )
+			return 0
+			;;
+	esac
+
+
+	if [[ "$cur" == -* ]]; then
+		COMPREPLY=( $( compgen -W '-s -o -m -M -z -l -L -w -a -t \
+			-c -S -d -p -C -T -8' -- $cur ) )
+	else
+		COMPREPLY=( $( command ls /etc/minirc.* | sed -e 's|/etc/minirc.||' | grep "^$cur" ) )
+	fi
+} &&
+complete -F _minicom minicom



More information about the Bash-completion-commits mailing list