add tesuite completion

This commit is contained in:
Tobias Powalowski 2024-08-01 19:40:14 +02:00
parent 0e52da72b2
commit 392bb69a10
3 changed files with 43 additions and 19 deletions

View file

@ -8,7 +8,7 @@ _usage () {
echo "This will check binaries from package, if they exist" echo "This will check binaries from package, if they exist"
echo "and report missing to binary.log" echo "and report missing to binary.log"
echo "" echo ""
echo -e "Usage: \e[1m\e${_BASENAME} <package>\e[m" echo -e "Usage: \e[1m${_BASENAME} <package>\e[m"
exit 0 exit 0
} }
[[ -z "${1}" ]] && _usage [[ -z "${1}" ]] && _usage

View file

@ -0,0 +1,24 @@
# SPDX-License-Identifier: GPL-3.0-or-later
# created by Tobias Powalowski <tpowa@archlinux.org>
_testsuite()
{
local cur prev OPTS
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
case $prev in
run)
return 0
;;
esac
case $cur in
*)
OPTS="run"
COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
return 0
;;
esac
compopt -o bashdefault -o default
return 0
}
complete -F _testsuite testsuite