summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur Zamarin <arthurzam@gentoo.org>2024-05-22 07:53:29 +0300
committerArthur Zamarin <arthurzam@gentoo.org>2024-05-22 07:53:29 +0300
commitb812d24b004dff668f4321c51124ef086a0e506e (patch)
tree1632291a3c937551916ee84b85c5294b13183bbc
parentadd completion for eshowkw from app-portage/gentoolkit (diff)
downloadgentoo-bashcomp-b812d24b004dff668f4321c51124ef086a0e506e.tar.gz
gentoo-bashcomp-b812d24b004dff668f4321c51124ef086a0e506e.tar.bz2
gentoo-bashcomp-b812d24b004dff668f4321c51124ef086a0e506e.zip
glsa-check: add missing args
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
-rw-r--r--completions/glsa-check19
1 files changed, 9 insertions, 10 deletions
diff --git a/completions/glsa-check b/completions/glsa-check
index d985429..b1ef0f1 100644
--- a/completions/glsa-check
+++ b/completions/glsa-check
@@ -4,29 +4,28 @@
# Distributed under the terms of the GNU General Public License, v2 or later
_glsa_check() {
- local cur opts
COMPREPLY=()
- cur="${COMP_WORDS[COMP_CWORD]}"
- opts="-l --list -d --dump --print -t --test -p --pretend -f --fix -i
+ local cur="${COMP_WORDS[COMP_CWORD]}"
+ local opts="-l --list -d --dump --print -t --test -p --pretend -f --fix -i
--inject -n --nocolor -e --emergelike -h --help -V --version -v --verbose
- -c --cve -m --mail"
+ -c --cve -m --mail -q --quiet -r --reverse"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; then
- COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
+ COMPREPLY=($(compgen -W "${opts}" -- "${cur}"))
return 0
fi
# too slow otherwise
- if [[ ! -f ${ROOT}/tmp/gc.out ]] || \
- [[ $(stat ${ROOT}/tmp/gc.out | \
- sed -n -e 's/^Modify: \([[:digit:]]\+-[[:digit:]]\+-[[:digit:]]\+\).*$/\1/p') != "$(date +%F)" ]]
+ local cache_file=${ROOT}/tmp/.completion.glsa-check.cache
+ if [[ ! -f ${cache_file} ]] || \
+ (( $(date +%s) - $(stat -c %Y "${cache_file}") > 4 * 3600 ))
then
glsa-check -nl 2>/dev/null | \
sed -n -e 's/^\([[:digit:]]\+-[[:digit:]]\+\) .*$/\1/p' > \
- ${ROOT}/tmp/gc.out
+ "${cache_file}"
fi
- COMPREPLY=($(compgen -W "${opts} $(< ${ROOT}/tmp/gc.out)" -- ${cur}))
+ COMPREPLY=($(compgen -W "${opts} all new affected $(< "${cache_file}")" -- "${cur}"))
} &&
complete -F _glsa_check glsa-check