diff options
| author | Drew DeVault <sir@cmpwn.com> | 2019-01-14 19:38:03 -0500 |
|---|---|---|
| committer | Drew DeVault <sir@cmpwn.com> | 2019-01-14 19:38:03 -0500 |
| commit | eba966c92b148fe5e33d7aebfb1fb60f3ac040cd (patch) | |
| tree | 67ccd1c429a30aac71ed86a5c8fa4a5ccf3a54f5 /completions/bash | |
| parent | 54a8a33381d9afd6eca2eee4ae70a9edab0f6d70 (diff) | |
Add completions1.0
Diffstat (limited to 'completions/bash')
| -rw-r--r-- | completions/bash/swaylock | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/completions/bash/swaylock b/completions/bash/swaylock new file mode 100644 index 0000000..3392548 --- /dev/null +++ b/completions/bash/swaylock @@ -0,0 +1,66 @@ +# swaylock(1) completion + +_swaylock() +{ + local cur prev + _get_comp_words_by_ref -n : cur prev + + short=( + -h + -c + -s + -t + -v + -i + -u + -f + ) + + long=( + --help + --color + --scaling + --tiling + --version + --image + --no-unlock-indicator + --daemonize + ) + + scaling=( + 'stretch' + 'fill' + 'fit' + 'center' + 'tile' + ) + + case $prev in + -c|--color) + return + ;; + --scaling) + COMPREPLY=($(compgen -W "${scaling[*]}" -- "$cur")) + return + ;; + -i|--image) + if grep -q : <<< "$cur"; then + output="${cur%%:*}:" + cur="${cur#*:}" + else + output= + fi + COMPREPLY=($(compgen -f -- "$cur")) + return + ;; + esac + + if [[ $cur == --* ]]; then + COMPREPLY=($(compgen -W "${long[*]}" -- "$cur")) + else + COMPREPLY=($(compgen -W "${short[*]}" -- "$cur")) + COMPREPLY+=($(compgen -W "${long[*]}" -- "$cur")) + fi + +} && +complete -F _swaylock swaylock |
