diff options
Diffstat (limited to 'completions/rsp.zsh')
| -rw-r--r-- | completions/rsp.zsh | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/completions/rsp.zsh b/completions/rsp.zsh new file mode 100644 index 0000000..c07feb1 --- /dev/null +++ b/completions/rsp.zsh | |||
| @@ -0,0 +1,26 @@ | |||
| 1 | #compdef rsp | ||
| 2 | |||
| 3 | _rsp() { | ||
| 4 | _arguments -C \ | ||
| 5 | '1:command:->cmd' \ | ||
| 6 | '*::args:->args' | ||
| 7 | |||
| 8 | case $state in | ||
| 9 | cmd) | ||
| 10 | _values 'command' \ | ||
| 11 | 'start' 'stop' 'restart' 'play' 'pause' 'resume' 'next' 'previous' \ | ||
| 12 | 'volume' 'shuffle' 'queue' 'status' 'scan' 'settings' | ||
| 13 | ;; | ||
| 14 | args) | ||
| 15 | # if first word is "play", complete files/dirs | ||
| 16 | if [[ $words[1] == play || $words[2] == play ]]; then | ||
| 17 | _files | ||
| 18 | else | ||
| 19 | # default: complete nothing (or you can list other subcommand args) | ||
| 20 | return 0 | ||
| 21 | fi | ||
| 22 | ;; | ||
| 23 | esac | ||
| 24 | } | ||
| 25 | |||
| 26 | compdef _rsp rsp | ||
