2018-07-27 15:31:04 +00:00
|
|
|
# sway(1) completion
|
|
|
|
|
|
|
|
_sway()
|
|
|
|
{
|
2022-03-27 08:50:12 +00:00
|
|
|
local cur prev short long
|
2018-07-27 15:31:04 +00:00
|
|
|
_get_comp_words_by_ref cur prev
|
|
|
|
|
|
|
|
short=(
|
|
|
|
-h
|
|
|
|
-c
|
|
|
|
-C
|
|
|
|
-d
|
|
|
|
-v
|
|
|
|
-V
|
|
|
|
)
|
|
|
|
|
|
|
|
long=(
|
|
|
|
--help
|
|
|
|
--config
|
|
|
|
--validate
|
|
|
|
--debug
|
|
|
|
--version
|
|
|
|
--verbose
|
|
|
|
--get-socketpath
|
|
|
|
)
|
|
|
|
|
|
|
|
case $prev in
|
|
|
|
-c|--config)
|
|
|
|
_filedir
|
|
|
|
return
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
if [[ $cur == --* ]]; then
|
|
|
|
COMPREPLY=($(compgen -W "${long[*]}" -- "$cur"))
|
|
|
|
elif [[ $cur == -* ]]; then
|
|
|
|
COMPREPLY=($(compgen -W "${short[*]}" -- "$cur"))
|
|
|
|
COMPREPLY+=($(compgen -W "${long[*]}" -- "$cur"))
|
|
|
|
else
|
|
|
|
COMPREPLY=($(compgen -W "${short[*]}" -- "$cur"))
|
|
|
|
COMPREPLY+=($(compgen -W "${long[*]}" -- "$cur"))
|
|
|
|
COMPREPLY+=($(compgen -c -- "$cur"))
|
|
|
|
fi
|
|
|
|
|
|
|
|
} &&
|
|
|
|
complete -F _sway sway
|