aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Walker <ka0ttic@gentoo.org>2005-04-11 12:47:16 +0000
committerAaron Walker <ka0ttic@gentoo.org>2005-04-11 12:47:16 +0000
commit67f1efc7ccef757d204e39588e25be03e39d3961 (patch)
treecea00d18c083841f505bace3724f762f8fedcb37
parentFixed do_list to ignore *~ (diff)
downloadeselect-67f1efc7ccef757d204e39588e25be03e39d3961.tar.gz
eselect-67f1efc7ccef757d204e39588e25be03e39d3961.tar.bz2
eselect-67f1efc7ccef757d204e39588e25be03e39d3961.zip
Added eclectic completion.
svn path=/trunk/; revision=21
-rw-r--r--misc/Makefile.am2
-rw-r--r--misc/eclectic.bashcomp26
2 files changed, 28 insertions, 0 deletions
diff --git a/misc/Makefile.am b/misc/Makefile.am
new file mode 100644
index 0000000..dbb3e34
--- /dev/null
+++ b/misc/Makefile.am
@@ -0,0 +1,2 @@
+EXTRA_DIST = eclectic.bashcomp
+MAINTAINERCLEANFILES = *~
diff --git a/misc/eclectic.bashcomp b/misc/eclectic.bashcomp
new file mode 100644
index 0000000..6a3ca2a
--- /dev/null
+++ b/misc/eclectic.bashcomp
@@ -0,0 +1,26 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+# bash command-line completion for eclectic
+# Author: Aaron Walker <ka0ttic@gentoo.org>
+
+_eclectic() {
+ local cur prev preprev sedcmd possibles
+ COMPREPLY=()
+ cur="${COMP_WORDS[COMP_CWORD]}"
+ prev="${COMP_WORDS[COMP_CWORD-1]}"
+ sedcmd='sed -n -e s/^[[:space:]]\+.*1m\([^[:space:]][[:alnum:]-]\+\).*[[:space:]]\+.*$/\1/p'
+
+ if [[ ${COMP_CWORD} -eq 1 ]] ; then
+ possibles=$(eclectic | ${sedcmd})
+ elif [[ ${COMP_CWORD} -eq 2 ]] ; then
+ possibles=$(eclectic ${prev} | ${sedcmd})
+ fi
+
+ COMPREPLY=($(compgen -W "${possibles}" -- ${cur}))
+ return 0
+}
+complete -F _eclectic eclectic
+
+# vim: set ft=sh tw=80 sw=4 et :