diff options
Diffstat (limited to '')
| -rw-r--r-- | completions/rsp.bash | 26 | ||||
| -rw-r--r-- | completions/rsp.fish | 11 | ||||
| -rw-r--r-- | completions/rsp.zsh | 26 |
3 files changed, 63 insertions, 0 deletions
diff --git a/completions/rsp.bash b/completions/rsp.bash new file mode 100644 index 0000000..55a25b0 --- /dev/null +++ b/completions/rsp.bash | |||
| @@ -0,0 +1,26 @@ | |||
| 1 | #!/usr/bin/env bash | ||
| 2 | |||
| 3 | _rsp() { | ||
| 4 | local cur prev words cword | ||
| 5 | _init_completion || return | ||
| 6 | |||
| 7 | case $prev in | ||
| 8 | rsp) | ||
| 9 | COMPREPLY=($(compgen -W "start stop restart play pause resume next previous volume shuffle queue status scan settings" -- "$cur")) | ||
| 10 | ;; | ||
| 11 | play) | ||
| 12 | _filedir | ||
| 13 | ;; | ||
| 14 | volume) | ||
| 15 | COMPREPLY=($(compgen -W "0 10 20 30 40 50 60 70 80 90 100" -- "$cur")) | ||
| 16 | ;; | ||
| 17 | shuffle) | ||
| 18 | COMPREPLY=($(compgen -W "on off album" -- "$cur")) | ||
| 19 | ;; | ||
| 20 | settings) | ||
| 21 | COMPREPLY=($(compgen -W "get set list unset" -- "$cur")) | ||
| 22 | ;; | ||
| 23 | esac | ||
| 24 | } | ||
| 25 | |||
| 26 | complete -F _rsp rsp | ||
diff --git a/completions/rsp.fish b/completions/rsp.fish new file mode 100644 index 0000000..1fd7483 --- /dev/null +++ b/completions/rsp.fish | |||
| @@ -0,0 +1,11 @@ | |||
| 1 | # rsp fish completion | ||
| 2 | |||
| 3 | complete -c rsp -n '__fish_use_subcommand' -a 'start stop restart play pause resume next previous volume shuffle queue status scan settings' -d 'Command' | ||
| 4 | |||
| 5 | complete -c rsp -n '__fish_seen_subcommand_from play' -f -d 'Audio file or directory' | ||
| 6 | |||
| 7 | complete -c rsp -n '__fish_seen_subcommand_from volume' -a '0 10 20 30 40 50 60 70 80 90 100' -d 'Volume level' | ||
| 8 | |||
| 9 | complete -c rsp -n '__fish_seen_subcommand_from shuffle' -a 'on off album' -d 'Shuffle mode' | ||
| 10 | |||
| 11 | complete -c rsp -n '__fish_seen_subcommand_from settings' -a 'get set list unset' -d 'Settings command' | ||
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 | ||
