From 392bb69a1047cd6ba712c35727c457de80fbec2c Mon Sep 17 00:00:00 2001 From: Tobias Powalowski Date: Thu, 1 Aug 2024 19:40:14 +0200 Subject: [PATCH] add tesuite completion --- usr/bin/archboot-binary-check.sh | 2 +- .../bash-completion/completions/testsuite | 24 +++++++++++++ usr/share/bash-completion/completions/update | 36 +++++++++---------- 3 files changed, 43 insertions(+), 19 deletions(-) create mode 100644 usr/share/bash-completion/completions/testsuite diff --git a/usr/bin/archboot-binary-check.sh b/usr/bin/archboot-binary-check.sh index 5273c06d6..d8ecc7ae2 100755 --- a/usr/bin/archboot-binary-check.sh +++ b/usr/bin/archboot-binary-check.sh @@ -8,7 +8,7 @@ _usage () { echo "This will check binaries from package, if they exist" echo "and report missing to binary.log" echo "" - echo -e "Usage: \e[1m\e${_BASENAME} \e[m" + echo -e "Usage: \e[1m${_BASENAME} \e[m" exit 0 } [[ -z "${1}" ]] && _usage diff --git a/usr/share/bash-completion/completions/testsuite b/usr/share/bash-completion/completions/testsuite new file mode 100644 index 000000000..be613ce36 --- /dev/null +++ b/usr/share/bash-completion/completions/testsuite @@ -0,0 +1,24 @@ +# SPDX-License-Identifier: GPL-3.0-or-later +# created by Tobias Powalowski +_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 diff --git a/usr/share/bash-completion/completions/update b/usr/share/bash-completion/completions/update index ca653b1e7..70815cb90 100644 --- a/usr/share/bash-completion/completions/update +++ b/usr/share/bash-completion/completions/update @@ -2,23 +2,23 @@ # created by Tobias Powalowski _update() { - local cur prev OPTS - COMPREPLY=() - cur="${COMP_WORDS[COMP_CWORD]}" - prev="${COMP_WORDS[COMP_CWORD-1]}" - case $prev in - -*) - return 0 - ;; - esac - case $cur in - *) - OPTS="$(update | rg '\-[a-z]' | choose 0 | sd '\x1B\[[0-9;]*[a-zA-Z]' '')" - COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) - return 0 - ;; - esac - compopt -o bashdefault -o default - return 0 + local cur prev OPTS + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + case $prev in + -*) + return 0 + ;; + esac + case $cur in + *) + OPTS="$(update | rg '\-[a-z]' | choose 0 | sd '\x1B\[[0-9;]*[a-zA-Z]' '')" + COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) + return 0 + ;; + esac + compopt -o bashdefault -o default + return 0 } complete -F _update update