diff options
author | 2009-05-23 10:55:05 +0000 | |
---|---|---|
committer | 2009-05-23 10:55:05 +0000 | |
commit | 3fcf8ee5bbd93bb0c1125b3ca5f6e552d8775f30 (patch) | |
tree | cdb6e61ca61b20dd33edd6184ca4a3a024daa4f0 /misc | |
parent | Use only POSIX basic regular expressions for sed. (diff) | |
download | eselect-3fcf8ee5bbd93bb0c1125b3ca5f6e552d8775f30.tar.gz eselect-3fcf8ee5bbd93bb0c1125b3ca5f6e552d8775f30.tar.bz2 eselect-3fcf8ee5bbd93bb0c1125b3ca5f6e552d8775f30.zip |
Add completion for "set", "enable", and "disable" subactions.
svn path=/trunk/; revision=561
Diffstat (limited to 'misc')
-rw-r--r-- | misc/eselect.bashcomp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/misc/eselect.bashcomp b/misc/eselect.bashcomp index 61e04a0..2904388 100644 --- a/misc/eselect.bashcomp +++ b/misc/eselect.bashcomp @@ -6,10 +6,11 @@ # Author: Aaron Walker <ka0ttic@gentoo.org> _eselect() { - local cur sedcmd possibles + local cur sedcmd sedcmd3 possibles COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" sedcmd='s/^ \([[:alnum:]-][[:alnum:]_-]*\)[[:space:],].*$/\1/p' + sedcmd3='s/^ \[[[:digit:]][[:digit:]]*\] *\([[:graph:]]*\).*$/\1/p' set - "${COMP_WORDS[@]:1}" while [[ $# -gt 1 && $1 == -* ]]; do @@ -21,6 +22,13 @@ _eselect() { | sed -n -e "${sedcmd}") ;; 2) possibles=$(eselect "$1" usage 2>/dev/null \ | sed -n -e "${sedcmd}") ;; + 3) + case $2 in + set|enable|disable) + possibles=$(eselect "$1" list 2>/dev/null \ + | sed -n -e "${sedcmd3}") ;; + esac + ;; esac [[ -n "${possibles}" ]] && \ |