diff options
author | Ulrich Müller <ulm@gentoo.org> | 2013-11-15 07:19:05 +0100 |
---|---|---|
committer | Ulrich Müller <ulm@gentoo.org> | 2013-11-15 07:19:05 +0100 |
commit | 14c4d2723db87329d23f40a7ed67cb44f9ced7fd (patch) | |
tree | f3581f9529091df08aca2178e963c7e1c310b5cb | |
parent | Silence profile symlink warning when using --force, bug 491216. (diff) | |
download | eselect-14c4d2723db87329d23f40a7ed67cb44f9ced7fd.tar.gz eselect-14c4d2723db87329d23f40a7ed67cb44f9ced7fd.tar.bz2 eselect-14c4d2723db87329d23f40a7ed67cb44f9ced7fd.zip |
Enable bash completion also for an empty list of words.
* misc/eselect.bashcomp (_eselect): Suggest possible completions
also for an empty list of words, i.e. when the user has not typed
any parameters yet.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | misc/eselect.bashcomp | 6 |
2 files changed, 9 insertions, 3 deletions
@@ -1,3 +1,9 @@ +2013-11-15 Ulrich Müller <ulm@gentoo.org> + + * misc/eselect.bashcomp (_eselect): Suggest possible completions + also for an empty list of words, i.e. when the user has not typed + any parameters yet. + 2013-11-14 Michael Marineau <mike@marineau.org> * modules/profile.eselect (set_symlink): Silence profile symlink diff --git a/misc/eselect.bashcomp b/misc/eselect.bashcomp index 30972fe..0ffe628 100644 --- a/misc/eselect.bashcomp +++ b/misc/eselect.bashcomp @@ -13,18 +13,18 @@ _eselect() { sedcmd2='s/^ \([[:alnum:]-][[:alnum:]_-]*\)[[:space:],].*$/\1/p' sedcmd3='s/^ \[[[:digit:]][[:digit:]]*\] *\([[:graph:]]*\).*$/\1/p' - set - "${COMP_WORDS[@]:1}" + set -- "${COMP_WORDS[@]:1}" # skip global options while [[ $# -gt 1 && $1 == -* ]]; do shift done # skip any subaction options while [[ $# -gt 3 && $3 == -* ]]; do - set - "${@:1:2}" "${@:4}" + set -- "${@:1:2}" "${@:4}" done case $# in - 1) possibles="${options} $(eselect --brief modules list 2>/dev/null)" + 0|1) possibles="${options} $(eselect --brief modules list 2>/dev/null)" ;; 2) possibles=$(eselect --brief "$1" usage 2>/dev/null \ | sed -n -e "${sedcmd2}") ;; |