summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLouis Sautier <sautier.louis@gmail.com>2018-06-10 18:26:46 +0200
committerPatrice Clement <monsieurp@gentoo.org>2018-06-24 00:23:00 +0200
commit48adce4356f46eda30265d2c5a6cb4055c16c5e3 (patch)
tree2242d9a3dbff1b43449e3e5be4bd2badf6833dc9
parentRemove OpenRC completions since they are provided upstream (diff)
downloadgentoo-bashcomp-48adce4356f46eda30265d2c5a6cb4055c16c5e3.tar.gz
gentoo-bashcomp-48adce4356f46eda30265d2c5a6cb4055c16c5e3.tar.bz2
gentoo-bashcomp-48adce4356f46eda30265d2c5a6cb4055c16c5e3.zip
emerge: add support for sets completion.gentoo-bashcomp-20180624
Based on Marco Genasci's patch and slightly modified to get rid of the unnecessary call to xargs. Courtesy of Marco Genasci <fedeliallalinea@gmail.com>. Closes: https://bugs.gentoo.org/235454 Closes: https://github.com/gentoo/gentoo-bashcomp/pull/4
-rw-r--r--completions/emerge6
1 files changed, 6 insertions, 0 deletions
diff --git a/completions/emerge b/completions/emerge
index d7da227..03cc503 100644
--- a/completions/emerge
+++ b/completions/emerge
@@ -26,6 +26,12 @@ _emerge()
return 0
fi
+ if [[ ${cur} =~ ^@ ]] ; then
+ local SET_LIST=($(emerge --list-sets))
+ COMPREPLY=($(compgen -W '${SET_LIST[@]/#/@}' ${cur}))
+ return 0
+ fi
+
# find action
for x in ${COMP_LINE} ; do
if [[ ${x} =~ ^(system|world)$ ]] || [[ ${x} =~ -[CPcs] ]] || \