From 48adce4356f46eda30265d2c5a6cb4055c16c5e3 Mon Sep 17 00:00:00 2001 From: Louis Sautier Date: Sun, 10 Jun 2018 18:26:46 +0200 Subject: emerge: add support for sets completion. Based on Marco Genasci's patch and slightly modified to get rid of the unnecessary call to xargs. Courtesy of Marco Genasci . Closes: https://bugs.gentoo.org/235454 Closes: https://github.com/gentoo/gentoo-bashcomp/pull/4 --- completions/emerge | 6 ++++++ 1 file changed, 6 insertions(+) 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] ]] || \ -- cgit v1.2.3-65-gdbad