-
Notifications
You must be signed in to change notification settings - Fork 0
/
swp.bc
35 lines (28 loc) · 601 Bytes
/
swp.bc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# bash completion for swp(1)
_swp(){
local cur prev opts
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
opts="
--version
--verbose
--debug
--wallpaper
--fullscreen
--borderless
--fifo=
--resolution=
--position=
--shader=
--file=
--filter="
# Default generate compare of all available option.
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
# If there's only one option, without =, then allow a space
if [[ ${#COMPREPLY[@]} == 1 && ${COMPREPLY[0]} != "--"*"=" ]] ; then
compopt +o nospace
fi
return 0
}
complete -o nospace -F _swp swp