feat(completion): added --debug-level
Signed-off-by: Boris Yumankulov <boria138@altlinux.org>
This commit is contained in:
@@ -1,19 +1,30 @@
|
|||||||
_portprotonqt() {
|
_portprotonqt_completions() {
|
||||||
local cur prev
|
local cur prev opts
|
||||||
_init_completion || return
|
COMPREPLY=()
|
||||||
|
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||||
|
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
||||||
|
|
||||||
case $prev in
|
# Available options
|
||||||
--help|-h)
|
opts="--fullscreen --debug-level --help -h"
|
||||||
return
|
|
||||||
|
# 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
|
esac
|
||||||
|
|
||||||
if [[ "$cur" == -* ]]; then
|
# Complete options
|
||||||
COMPREPLY=( $( compgen -W '--fullscreen' -- "$cur" ) )
|
if [[ ${cur} == -* ]]; then
|
||||||
|
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
return 0
|
|
||||||
}
|
}
|
||||||
|
|
||||||
complete -F _portprotonqt portprotonqt
|
complete -F _portprotonqt_completions portprotonqt
|
||||||
|
Reference in New Issue
Block a user