aboutsummaryrefslogtreecommitdiffstats
path: root/completions/bash/sway
diff options
context:
space:
mode:
Diffstat (limited to 'completions/bash/sway')
-rw-r--r--completions/bash/sway46
1 files changed, 46 insertions, 0 deletions
diff --git a/completions/bash/sway b/completions/bash/sway
new file mode 100644
index 00000000..edd752cd
--- /dev/null
+++ b/completions/bash/sway
@@ -0,0 +1,46 @@
1# sway(1) completion
2
3_sway()
4{
5 local cur prev
6 _get_comp_words_by_ref cur prev
7
8 short=(
9 -h
10 -c
11 -C
12 -d
13 -v
14 -V
15 )
16
17 long=(
18 --help
19 --config
20 --validate
21 --debug
22 --version
23 --verbose
24 --get-socketpath
25 )
26
27 case $prev in
28 -c|--config)
29 _filedir
30 return
31 ;;
32 esac
33
34 if [[ $cur == --* ]]; then
35 COMPREPLY=($(compgen -W "${long[*]}" -- "$cur"))
36 elif [[ $cur == -* ]]; then
37 COMPREPLY=($(compgen -W "${short[*]}" -- "$cur"))
38 COMPREPLY+=($(compgen -W "${long[*]}" -- "$cur"))
39 else
40 COMPREPLY=($(compgen -W "${short[*]}" -- "$cur"))
41 COMPREPLY+=($(compgen -W "${long[*]}" -- "$cur"))
42 COMPREPLY+=($(compgen -c -- "$cur"))
43 fi
44
45} &&
46complete -F _sway sway