From d5c53ed1aa55d1637facbc54a0c86c5775c19c6a Mon Sep 17 00:00:00 2001 From: Boris Yumankulov Date: Tue, 23 Sep 2025 00:19:40 +0500 Subject: [PATCH] feat(completion): added --debug-level Signed-off-by: Boris Yumankulov --- .../bash-completion/completions/portprotonqt | 33 ++++++++++++------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/build-aux/share/bash-completion/completions/portprotonqt b/build-aux/share/bash-completion/completions/portprotonqt index 19f5e33..acf9750 100644 --- a/build-aux/share/bash-completion/completions/portprotonqt +++ b/build-aux/share/bash-completion/completions/portprotonqt @@ -1,19 +1,30 @@ -_portprotonqt() { - local cur prev - _init_completion || return +_portprotonqt_completions() { + local cur prev opts + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" - case $prev in - --help|-h) - return + # Available options + opts="--fullscreen --debug-level --help -h" + + # Debug level choices + debug_levels="ALL DEBUG INFO WARNING ERROR CRITICAL" + + case "${prev}" in + --debug-level) + # Complete debug levels + COMPREPLY=( $(compgen -W "${debug_levels}" -- ${cur}) ) + return 0 + ;; + *) ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--fullscreen' -- "$cur" ) ) + # Complete options + if [[ ${cur} == -* ]]; then + COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) return 0 fi - - return 0 } -complete -F _portprotonqt portprotonqt +complete -F _portprotonqt_completions portprotonqt