diff options
Diffstat (limited to '')
| -rw-r--r-- | completions/rsp.bash | 52 | ||||
| -rw-r--r-- | completions/rsp.elvish | 224 | ||||
| -rw-r--r-- | completions/rsp.fish | 59 | ||||
| -rw-r--r-- | completions/rsp.powershell | 280 | ||||
| -rw-r--r-- | completions/rsp.zsh | 70 |
5 files changed, 577 insertions, 108 deletions
diff --git a/completions/rsp.bash b/completions/rsp.bash index 4ea8603..1812802 100644 --- a/completions/rsp.bash +++ b/completions/rsp.bash | |||
| @@ -1,14 +1,3 @@ | |||
| 1 | _rsp_play_query_completions() { | ||
| 2 | local cur="${COMP_WORDS[COMP_CWORD]}" | ||
| 3 | # Only do dynamic completion if COMPREPLY is empty (no flag matched) | ||
| 4 | # and the current word doesn't start with - | ||
| 5 | if [[ ${#COMPREPLY[@]} -eq 0 && "$cur" != -* ]]; then | ||
| 6 | local -a artists | ||
| 7 | artists=($(rsp play --list 2>/dev/null)) | ||
| 8 | COMPREPLY=( $(compgen -W "${artists[*]}" -- "$cur") ) | ||
| 9 | fi | ||
| 10 | } | ||
| 11 | |||
| 12 | _rsp() { | 1 | _rsp() { |
| 13 | local i cur prev opts cmd | 2 | local i cur prev opts cmd |
| 14 | COMPREPLY=() | 3 | COMPREPLY=() |
| @@ -63,8 +52,8 @@ _rsp() { | |||
| 63 | rsp,shuffle) | 52 | rsp,shuffle) |
| 64 | cmd="rsp__subcmd__shuffle" | 53 | cmd="rsp__subcmd__shuffle" |
| 65 | ;; | 54 | ;; |
| 66 | rsp,start) | 55 | rsp,start-daemon) |
| 67 | cmd="rsp__subcmd__start" | 56 | cmd="rsp__subcmd__start__subcmd__daemon" |
| 68 | ;; | 57 | ;; |
| 69 | rsp,status) | 58 | rsp,status) |
| 70 | cmd="rsp__subcmd__status" | 59 | cmd="rsp__subcmd__status" |
| @@ -72,8 +61,8 @@ _rsp() { | |||
| 72 | rsp,stop) | 61 | rsp,stop) |
| 73 | cmd="rsp__subcmd__stop" | 62 | cmd="rsp__subcmd__stop" |
| 74 | ;; | 63 | ;; |
| 75 | rsp,stop-playback) | 64 | rsp,stop-daemon) |
| 76 | cmd="rsp__subcmd__stop__subcmd__playback" | 65 | cmd="rsp__subcmd__stop__subcmd__daemon" |
| 77 | ;; | 66 | ;; |
| 78 | rsp,toggle) | 67 | rsp,toggle) |
| 79 | cmd="rsp__subcmd__toggle" | 68 | cmd="rsp__subcmd__toggle" |
| @@ -117,8 +106,8 @@ _rsp() { | |||
| 117 | rsp__subcmd__help,shuffle) | 106 | rsp__subcmd__help,shuffle) |
| 118 | cmd="rsp__subcmd__help__subcmd__shuffle" | 107 | cmd="rsp__subcmd__help__subcmd__shuffle" |
| 119 | ;; | 108 | ;; |
| 120 | rsp__subcmd__help,start) | 109 | rsp__subcmd__help,start-daemon) |
| 121 | cmd="rsp__subcmd__help__subcmd__start" | 110 | cmd="rsp__subcmd__help__subcmd__start__subcmd__daemon" |
| 122 | ;; | 111 | ;; |
| 123 | rsp__subcmd__help,status) | 112 | rsp__subcmd__help,status) |
| 124 | cmd="rsp__subcmd__help__subcmd__status" | 113 | cmd="rsp__subcmd__help__subcmd__status" |
| @@ -126,8 +115,8 @@ _rsp() { | |||
| 126 | rsp__subcmd__help,stop) | 115 | rsp__subcmd__help,stop) |
| 127 | cmd="rsp__subcmd__help__subcmd__stop" | 116 | cmd="rsp__subcmd__help__subcmd__stop" |
| 128 | ;; | 117 | ;; |
| 129 | rsp__subcmd__help,stop-playback) | 118 | rsp__subcmd__help,stop-daemon) |
| 130 | cmd="rsp__subcmd__help__subcmd__stop__subcmd__playback" | 119 | cmd="rsp__subcmd__help__subcmd__stop__subcmd__daemon" |
| 131 | ;; | 120 | ;; |
| 132 | rsp__subcmd__help,toggle) | 121 | rsp__subcmd__help,toggle) |
| 133 | cmd="rsp__subcmd__help__subcmd__toggle" | 122 | cmd="rsp__subcmd__help__subcmd__toggle" |
| @@ -184,7 +173,7 @@ _rsp() { | |||
| 184 | 173 | ||
| 185 | case "${cmd}" in | 174 | case "${cmd}" in |
| 186 | rsp) | 175 | rsp) |
| 187 | opts="-h --help start stop restart play pause resume toggle stop-playback next previous volume shuffle queue status scan settings completions help" | 176 | opts="-h --help start-daemon stop-daemon restart play pause resume toggle stop next previous volume shuffle queue status scan settings completions help" |
| 188 | if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; then | 177 | if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; then |
| 189 | COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) | 178 | COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) |
| 190 | return 0 | 179 | return 0 |
| @@ -198,16 +187,12 @@ _rsp() { | |||
| 198 | return 0 | 187 | return 0 |
| 199 | ;; | 188 | ;; |
| 200 | rsp__subcmd__completions) | 189 | rsp__subcmd__completions) |
| 201 | opts="-h --shell --help" | 190 | opts="-h --help [SHELL]" |
| 202 | if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then | 191 | if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then |
| 203 | COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) | 192 | COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) |
| 204 | return 0 | 193 | return 0 |
| 205 | fi | 194 | fi |
| 206 | case "${prev}" in | 195 | case "${prev}" in |
| 207 | --shell) | ||
| 208 | COMPREPLY=($(compgen -W "bash elvish fish powershell zsh" -- "${cur}")) | ||
| 209 | return 0 | ||
| 210 | ;; | ||
| 211 | *) | 196 | *) |
| 212 | COMPREPLY=() | 197 | COMPREPLY=() |
| 213 | ;; | 198 | ;; |
| @@ -216,7 +201,7 @@ _rsp() { | |||
| 216 | return 0 | 201 | return 0 |
| 217 | ;; | 202 | ;; |
| 218 | rsp__subcmd__help) | 203 | rsp__subcmd__help) |
| 219 | opts="start stop restart play pause resume toggle stop-playback next previous volume shuffle queue status scan settings completions help" | 204 | opts="start-daemon stop-daemon restart play pause resume toggle stop next previous volume shuffle queue status scan settings completions help" |
| 220 | if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then | 205 | if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then |
| 221 | COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) | 206 | COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) |
| 222 | return 0 | 207 | return 0 |
| @@ -453,7 +438,7 @@ _rsp() { | |||
| 453 | COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) | 438 | COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) |
| 454 | return 0 | 439 | return 0 |
| 455 | ;; | 440 | ;; |
| 456 | rsp__subcmd__help__subcmd__start) | 441 | rsp__subcmd__help__subcmd__start__subcmd__daemon) |
| 457 | opts="" | 442 | opts="" |
| 458 | if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then | 443 | if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then |
| 459 | COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) | 444 | COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) |
| @@ -495,7 +480,7 @@ _rsp() { | |||
| 495 | COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) | 480 | COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) |
| 496 | return 0 | 481 | return 0 |
| 497 | ;; | 482 | ;; |
| 498 | rsp__subcmd__help__subcmd__stop__subcmd__playback) | 483 | rsp__subcmd__help__subcmd__stop__subcmd__daemon) |
| 499 | opts="" | 484 | opts="" |
| 500 | if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then | 485 | if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then |
| 501 | COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) | 486 | COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) |
| @@ -566,7 +551,7 @@ _rsp() { | |||
| 566 | return 0 | 551 | return 0 |
| 567 | ;; | 552 | ;; |
| 568 | rsp__subcmd__play) | 553 | rsp__subcmd__play) |
| 569 | opts="-i -n -l -L -h --now --next --last --list --help [QUERY]" | 554 | opts="-i -n -h --now --next --help [QUERY]" |
| 570 | if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then | 555 | if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then |
| 571 | COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) | 556 | COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) |
| 572 | return 0 | 557 | return 0 |
| @@ -577,10 +562,7 @@ _rsp() { | |||
| 577 | ;; | 562 | ;; |
| 578 | esac | 563 | esac |
| 579 | COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) | 564 | COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) |
| 580 | 565 | return 0 | |
| 581 | # Dynamic artist/album completion for query argument | ||
| 582 | _rsp_play_query_completions | ||
| 583 | return 0 | ||
| 584 | ;; | 566 | ;; |
| 585 | rsp__subcmd__previous) | 567 | rsp__subcmd__previous) |
| 586 | opts="-h --help" | 568 | opts="-h --help" |
| @@ -824,7 +806,7 @@ return 0 | |||
| 824 | COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) | 806 | COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) |
| 825 | return 0 | 807 | return 0 |
| 826 | ;; | 808 | ;; |
| 827 | rsp__subcmd__start) | 809 | rsp__subcmd__start__subcmd__daemon) |
| 828 | opts="-h --help" | 810 | opts="-h --help" |
| 829 | if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then | 811 | if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then |
| 830 | COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) | 812 | COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) |
| @@ -866,7 +848,7 @@ return 0 | |||
| 866 | COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) | 848 | COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) |
| 867 | return 0 | 849 | return 0 |
| 868 | ;; | 850 | ;; |
| 869 | rsp__subcmd__stop__subcmd__playback) | 851 | rsp__subcmd__stop__subcmd__daemon) |
| 870 | opts="-h --help" | 852 | opts="-h --help" |
| 871 | if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then | 853 | if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then |
| 872 | COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) | 854 | COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) |
diff --git a/completions/rsp.elvish b/completions/rsp.elvish new file mode 100644 index 0000000..54ccdfe --- /dev/null +++ b/completions/rsp.elvish | |||
| @@ -0,0 +1,224 @@ | |||
| 1 | |||
| 2 | use builtin; | ||
| 3 | use str; | ||
| 4 | |||
| 5 | set edit:completion:arg-completer[rsp] = {|@words| | ||
| 6 | fn spaces {|n| | ||
| 7 | builtin:repeat $n ' ' | str:join '' | ||
| 8 | } | ||
| 9 | fn cand {|text desc| | ||
| 10 | edit:complex-candidate $text &display=$text' '(spaces (- 14 (wcswidth $text)))$desc | ||
| 11 | } | ||
| 12 | var command = 'rsp' | ||
| 13 | for word $words[1..-1] { | ||
| 14 | if (str:has-prefix $word '-') { | ||
| 15 | break | ||
| 16 | } | ||
| 17 | set command = $command';'$word | ||
| 18 | } | ||
| 19 | var completions = [ | ||
| 20 | &'rsp'= { | ||
| 21 | cand -h 'Print help' | ||
| 22 | cand --help 'Print help' | ||
| 23 | cand start-daemon 'Start the daemon' | ||
| 24 | cand stop-daemon 'Stop the daemon' | ||
| 25 | cand restart 'Restart the daemon (kill existing and start new)' | ||
| 26 | cand play 'Play a track, album, or artist' | ||
| 27 | cand pause 'Pause playback' | ||
| 28 | cand resume 'Resume playback' | ||
| 29 | cand toggle 'Toggle play/pause' | ||
| 30 | cand stop 'Stop playback' | ||
| 31 | cand next 'Skip to next track' | ||
| 32 | cand previous 'Skip to previous track' | ||
| 33 | cand volume 'Set volume (0-100)' | ||
| 34 | cand shuffle 'Shuffle mode' | ||
| 35 | cand queue 'Queue management' | ||
| 36 | cand status 'Show player status' | ||
| 37 | cand scan 'Scan music paths to populate database' | ||
| 38 | cand settings 'Settings management' | ||
| 39 | cand completions 'Generate shell completions (developer only)' | ||
| 40 | cand help 'Print this message or the help of the given subcommand(s)' | ||
| 41 | } | ||
| 42 | &'rsp;start-daemon'= { | ||
| 43 | cand -h 'Print help' | ||
| 44 | cand --help 'Print help' | ||
| 45 | } | ||
| 46 | &'rsp;stop-daemon'= { | ||
| 47 | cand -h 'Print help' | ||
| 48 | cand --help 'Print help' | ||
| 49 | } | ||
| 50 | &'rsp;restart'= { | ||
| 51 | cand -h 'Print help' | ||
| 52 | cand --help 'Print help' | ||
| 53 | } | ||
| 54 | &'rsp;play'= { | ||
| 55 | cand -i 'Add after current track and skip to it' | ||
| 56 | cand --now 'Add after current track and skip to it' | ||
| 57 | cand -n 'Add to queue after current track (don''t skip)' | ||
| 58 | cand --next 'Add to queue after current track (don''t skip)' | ||
| 59 | cand -h 'Print help' | ||
| 60 | cand --help 'Print help' | ||
| 61 | } | ||
| 62 | &'rsp;pause'= { | ||
| 63 | cand -h 'Print help' | ||
| 64 | cand --help 'Print help' | ||
| 65 | } | ||
| 66 | &'rsp;resume'= { | ||
| 67 | cand -h 'Print help' | ||
| 68 | cand --help 'Print help' | ||
| 69 | } | ||
| 70 | &'rsp;toggle'= { | ||
| 71 | cand -h 'Print help' | ||
| 72 | cand --help 'Print help' | ||
| 73 | } | ||
| 74 | &'rsp;stop'= { | ||
| 75 | cand -h 'Print help' | ||
| 76 | cand --help 'Print help' | ||
| 77 | } | ||
| 78 | &'rsp;next'= { | ||
| 79 | cand -h 'Print help' | ||
| 80 | cand --help 'Print help' | ||
| 81 | } | ||
| 82 | &'rsp;previous'= { | ||
| 83 | cand -h 'Print help' | ||
| 84 | cand --help 'Print help' | ||
| 85 | } | ||
| 86 | &'rsp;volume'= { | ||
| 87 | cand -h 'Print help' | ||
| 88 | cand --help 'Print help' | ||
| 89 | } | ||
| 90 | &'rsp;shuffle'= { | ||
| 91 | cand -h 'Print help' | ||
| 92 | cand --help 'Print help' | ||
| 93 | } | ||
| 94 | &'rsp;queue'= { | ||
| 95 | cand -h 'Print help' | ||
| 96 | cand --help 'Print help' | ||
| 97 | } | ||
| 98 | &'rsp;status'= { | ||
| 99 | cand -h 'Print help' | ||
| 100 | cand --help 'Print help' | ||
| 101 | } | ||
| 102 | &'rsp;scan'= { | ||
| 103 | cand --paths 'paths' | ||
| 104 | cand --force 'force' | ||
| 105 | cand -h 'Print help' | ||
| 106 | cand --help 'Print help' | ||
| 107 | } | ||
| 108 | &'rsp;settings'= { | ||
| 109 | cand -h 'Print help' | ||
| 110 | cand --help 'Print help' | ||
| 111 | cand get 'Get a setting value' | ||
| 112 | cand set 'Set a setting value' | ||
| 113 | cand list 'List all settings' | ||
| 114 | cand unset 'Unset a setting' | ||
| 115 | cand help 'Print this message or the help of the given subcommand(s)' | ||
| 116 | } | ||
| 117 | &'rsp;settings;get'= { | ||
| 118 | cand -h 'Print help' | ||
| 119 | cand --help 'Print help' | ||
| 120 | } | ||
| 121 | &'rsp;settings;set'= { | ||
| 122 | cand -h 'Print help' | ||
| 123 | cand --help 'Print help' | ||
| 124 | } | ||
| 125 | &'rsp;settings;list'= { | ||
| 126 | cand -h 'Print help' | ||
| 127 | cand --help 'Print help' | ||
| 128 | } | ||
| 129 | &'rsp;settings;unset'= { | ||
| 130 | cand -h 'Print help' | ||
| 131 | cand --help 'Print help' | ||
| 132 | } | ||
| 133 | &'rsp;settings;help'= { | ||
| 134 | cand get 'Get a setting value' | ||
| 135 | cand set 'Set a setting value' | ||
| 136 | cand list 'List all settings' | ||
| 137 | cand unset 'Unset a setting' | ||
| 138 | cand help 'Print this message or the help of the given subcommand(s)' | ||
| 139 | } | ||
| 140 | &'rsp;settings;help;get'= { | ||
| 141 | } | ||
| 142 | &'rsp;settings;help;set'= { | ||
| 143 | } | ||
| 144 | &'rsp;settings;help;list'= { | ||
| 145 | } | ||
| 146 | &'rsp;settings;help;unset'= { | ||
| 147 | } | ||
| 148 | &'rsp;settings;help;help'= { | ||
| 149 | } | ||
| 150 | &'rsp;completions'= { | ||
| 151 | cand -h 'Print help' | ||
| 152 | cand --help 'Print help' | ||
| 153 | } | ||
| 154 | &'rsp;help'= { | ||
| 155 | cand start-daemon 'Start the daemon' | ||
| 156 | cand stop-daemon 'Stop the daemon' | ||
| 157 | cand restart 'Restart the daemon (kill existing and start new)' | ||
| 158 | cand play 'Play a track, album, or artist' | ||
| 159 | cand pause 'Pause playback' | ||
| 160 | cand resume 'Resume playback' | ||
| 161 | cand toggle 'Toggle play/pause' | ||
| 162 | cand stop 'Stop playback' | ||
| 163 | cand next 'Skip to next track' | ||
| 164 | cand previous 'Skip to previous track' | ||
| 165 | cand volume 'Set volume (0-100)' | ||
| 166 | cand shuffle 'Shuffle mode' | ||
| 167 | cand queue 'Queue management' | ||
| 168 | cand status 'Show player status' | ||
| 169 | cand scan 'Scan music paths to populate database' | ||
| 170 | cand settings 'Settings management' | ||
| 171 | cand completions 'Generate shell completions (developer only)' | ||
| 172 | cand help 'Print this message or the help of the given subcommand(s)' | ||
| 173 | } | ||
| 174 | &'rsp;help;start-daemon'= { | ||
| 175 | } | ||
| 176 | &'rsp;help;stop-daemon'= { | ||
| 177 | } | ||
| 178 | &'rsp;help;restart'= { | ||
| 179 | } | ||
| 180 | &'rsp;help;play'= { | ||
| 181 | } | ||
| 182 | &'rsp;help;pause'= { | ||
| 183 | } | ||
| 184 | &'rsp;help;resume'= { | ||
| 185 | } | ||
| 186 | &'rsp;help;toggle'= { | ||
| 187 | } | ||
| 188 | &'rsp;help;stop'= { | ||
| 189 | } | ||
| 190 | &'rsp;help;next'= { | ||
| 191 | } | ||
| 192 | &'rsp;help;previous'= { | ||
| 193 | } | ||
| 194 | &'rsp;help;volume'= { | ||
| 195 | } | ||
| 196 | &'rsp;help;shuffle'= { | ||
| 197 | } | ||
| 198 | &'rsp;help;queue'= { | ||
| 199 | } | ||
| 200 | &'rsp;help;status'= { | ||
| 201 | } | ||
| 202 | &'rsp;help;scan'= { | ||
| 203 | } | ||
| 204 | &'rsp;help;settings'= { | ||
| 205 | cand get 'Get a setting value' | ||
| 206 | cand set 'Set a setting value' | ||
| 207 | cand list 'List all settings' | ||
| 208 | cand unset 'Unset a setting' | ||
| 209 | } | ||
| 210 | &'rsp;help;settings;get'= { | ||
| 211 | } | ||
| 212 | &'rsp;help;settings;set'= { | ||
| 213 | } | ||
| 214 | &'rsp;help;settings;list'= { | ||
| 215 | } | ||
| 216 | &'rsp;help;settings;unset'= { | ||
| 217 | } | ||
| 218 | &'rsp;help;completions'= { | ||
| 219 | } | ||
| 220 | &'rsp;help;help'= { | ||
| 221 | } | ||
| 222 | ] | ||
| 223 | $completions[$command] | ||
| 224 | } | ||
diff --git a/completions/rsp.fish b/completions/rsp.fish index d0e391d..265fe37 100644 --- a/completions/rsp.fish +++ b/completions/rsp.fish | |||
| @@ -25,14 +25,14 @@ function __fish_rsp_using_subcommand | |||
| 25 | end | 25 | end |
| 26 | 26 | ||
| 27 | complete -c rsp -n "__fish_rsp_needs_command" -s h -l help -d 'Print help' | 27 | complete -c rsp -n "__fish_rsp_needs_command" -s h -l help -d 'Print help' |
| 28 | complete -c rsp -n "__fish_rsp_needs_command" -f -a "start" -d 'Start the daemon' | 28 | complete -c rsp -n "__fish_rsp_needs_command" -f -a "start-daemon" -d 'Start the daemon' |
| 29 | complete -c rsp -n "__fish_rsp_needs_command" -f -a "stop" -d 'Stop the daemon' | 29 | complete -c rsp -n "__fish_rsp_needs_command" -f -a "stop-daemon" -d 'Stop the daemon' |
| 30 | complete -c rsp -n "__fish_rsp_needs_command" -f -a "restart" -d 'Restart the daemon (kill existing and start new)' | 30 | complete -c rsp -n "__fish_rsp_needs_command" -f -a "restart" -d 'Restart the daemon (kill existing and start new)' |
| 31 | complete -c rsp -n "__fish_rsp_needs_command" -f -a "play" -d 'Play a track, album, or artist' | 31 | complete -c rsp -n "__fish_rsp_needs_command" -f -a "play" -d 'Play a track, album, or artist' |
| 32 | complete -c rsp -n "__fish_rsp_needs_command" -f -a "pause" -d 'Pause playback' | 32 | complete -c rsp -n "__fish_rsp_needs_command" -f -a "pause" -d 'Pause playback' |
| 33 | complete -c rsp -n "__fish_rsp_needs_command" -f -a "resume" -d 'Resume playback' | 33 | complete -c rsp -n "__fish_rsp_needs_command" -f -a "resume" -d 'Resume playback' |
| 34 | complete -c rsp -n "__fish_rsp_needs_command" -f -a "toggle" -d 'Toggle play/pause' | 34 | complete -c rsp -n "__fish_rsp_needs_command" -f -a "toggle" -d 'Toggle play/pause' |
| 35 | complete -c rsp -n "__fish_rsp_needs_command" -f -a "stop-playback" -d 'Stop playback' | 35 | complete -c rsp -n "__fish_rsp_needs_command" -f -a "stop" -d 'Stop playback' |
| 36 | complete -c rsp -n "__fish_rsp_needs_command" -f -a "next" -d 'Skip to next track' | 36 | complete -c rsp -n "__fish_rsp_needs_command" -f -a "next" -d 'Skip to next track' |
| 37 | complete -c rsp -n "__fish_rsp_needs_command" -f -a "previous" -d 'Skip to previous track' | 37 | complete -c rsp -n "__fish_rsp_needs_command" -f -a "previous" -d 'Skip to previous track' |
| 38 | complete -c rsp -n "__fish_rsp_needs_command" -f -a "volume" -d 'Set volume (0-100)' | 38 | complete -c rsp -n "__fish_rsp_needs_command" -f -a "volume" -d 'Set volume (0-100)' |
| @@ -41,20 +41,18 @@ complete -c rsp -n "__fish_rsp_needs_command" -f -a "queue" -d 'Queue management | |||
| 41 | complete -c rsp -n "__fish_rsp_needs_command" -f -a "status" -d 'Show player status' | 41 | complete -c rsp -n "__fish_rsp_needs_command" -f -a "status" -d 'Show player status' |
| 42 | complete -c rsp -n "__fish_rsp_needs_command" -f -a "scan" -d 'Scan music paths to populate database' | 42 | complete -c rsp -n "__fish_rsp_needs_command" -f -a "scan" -d 'Scan music paths to populate database' |
| 43 | complete -c rsp -n "__fish_rsp_needs_command" -f -a "settings" -d 'Settings management' | 43 | complete -c rsp -n "__fish_rsp_needs_command" -f -a "settings" -d 'Settings management' |
| 44 | complete -c rsp -n "__fish_rsp_needs_command" -f -a "completions" -d 'Generate shell completions and write to completions/ directory (bash, elvish, fish, powershell, zsh)' | 44 | complete -c rsp -n "__fish_rsp_needs_command" -f -a "completions" -d 'Generate shell completions (developer only)' |
| 45 | complete -c rsp -n "__fish_rsp_needs_command" -f -a "help" -d 'Print this message or the help of the given subcommand(s)' | 45 | complete -c rsp -n "__fish_rsp_needs_command" -f -a "help" -d 'Print this message or the help of the given subcommand(s)' |
| 46 | complete -c rsp -n "__fish_rsp_using_subcommand start" -s h -l help -d 'Print help' | 46 | complete -c rsp -n "__fish_rsp_using_subcommand start-daemon" -s h -l help -d 'Print help' |
| 47 | complete -c rsp -n "__fish_rsp_using_subcommand stop" -s h -l help -d 'Print help' | 47 | complete -c rsp -n "__fish_rsp_using_subcommand stop-daemon" -s h -l help -d 'Print help' |
| 48 | complete -c rsp -n "__fish_rsp_using_subcommand restart" -s h -l help -d 'Print help' | 48 | complete -c rsp -n "__fish_rsp_using_subcommand restart" -s h -l help -d 'Print help' |
| 49 | complete -c rsp -n "__fish_rsp_using_subcommand play" -s i -l now -d 'Play immediately (add after current and skip to it)' | 49 | complete -c rsp -n "__fish_rsp_using_subcommand play" -s i -l now -d 'Add after current track and skip to it' |
| 50 | complete -c rsp -n "__fish_rsp_using_subcommand play" -s n -l next -d 'Add to queue after current track (don\'t skip)' | 50 | complete -c rsp -n "__fish_rsp_using_subcommand play" -s n -l next -d 'Add to queue after current track (don\'t skip)' |
| 51 | complete -c rsp -n "__fish_rsp_using_subcommand play" -s l -l last -d 'Add to end of queue (default)' | ||
| 52 | complete -c rsp -n "__fish_rsp_using_subcommand play" -s L -l list -d 'List available artists/albums' | ||
| 53 | complete -c rsp -n "__fish_rsp_using_subcommand play" -s h -l help -d 'Print help' | 51 | complete -c rsp -n "__fish_rsp_using_subcommand play" -s h -l help -d 'Print help' |
| 54 | complete -c rsp -n "__fish_rsp_using_subcommand pause" -s h -l help -d 'Print help' | 52 | complete -c rsp -n "__fish_rsp_using_subcommand pause" -s h -l help -d 'Print help' |
| 55 | complete -c rsp -n "__fish_rsp_using_subcommand resume" -s h -l help -d 'Print help' | 53 | complete -c rsp -n "__fish_rsp_using_subcommand resume" -s h -l help -d 'Print help' |
| 56 | complete -c rsp -n "__fish_rsp_using_subcommand toggle" -s h -l help -d 'Print help' | 54 | complete -c rsp -n "__fish_rsp_using_subcommand toggle" -s h -l help -d 'Print help' |
| 57 | complete -c rsp -n "__fish_rsp_using_subcommand stop-playback" -s h -l help -d 'Print help' | 55 | complete -c rsp -n "__fish_rsp_using_subcommand stop" -s h -l help -d 'Print help' |
| 58 | complete -c rsp -n "__fish_rsp_using_subcommand next" -s h -l help -d 'Print help' | 56 | complete -c rsp -n "__fish_rsp_using_subcommand next" -s h -l help -d 'Print help' |
| 59 | complete -c rsp -n "__fish_rsp_using_subcommand previous" -s h -l help -d 'Print help' | 57 | complete -c rsp -n "__fish_rsp_using_subcommand previous" -s h -l help -d 'Print help' |
| 60 | complete -c rsp -n "__fish_rsp_using_subcommand volume" -s h -l help -d 'Print help' | 58 | complete -c rsp -n "__fish_rsp_using_subcommand volume" -s h -l help -d 'Print help' |
| @@ -79,30 +77,25 @@ complete -c rsp -n "__fish_rsp_using_subcommand settings; and __fish_seen_subcom | |||
| 79 | complete -c rsp -n "__fish_rsp_using_subcommand settings; and __fish_seen_subcommand_from help" -f -a "list" -d 'List all settings' | 77 | complete -c rsp -n "__fish_rsp_using_subcommand settings; and __fish_seen_subcommand_from help" -f -a "list" -d 'List all settings' |
| 80 | complete -c rsp -n "__fish_rsp_using_subcommand settings; and __fish_seen_subcommand_from help" -f -a "unset" -d 'Unset a setting' | 78 | complete -c rsp -n "__fish_rsp_using_subcommand settings; and __fish_seen_subcommand_from help" -f -a "unset" -d 'Unset a setting' |
| 81 | complete -c rsp -n "__fish_rsp_using_subcommand settings; and __fish_seen_subcommand_from help" -f -a "help" -d 'Print this message or the help of the given subcommand(s)' | 79 | complete -c rsp -n "__fish_rsp_using_subcommand settings; and __fish_seen_subcommand_from help" -f -a "help" -d 'Print this message or the help of the given subcommand(s)' |
| 82 | complete -c rsp -n "__fish_rsp_using_subcommand completions" -l shell -d 'Also print to stdout for a specific shell' -r -f -a "bash\t'' | ||
| 83 | elvish\t'' | ||
| 84 | fish\t'' | ||
| 85 | powershell\t'' | ||
| 86 | zsh\t''" | ||
| 87 | complete -c rsp -n "__fish_rsp_using_subcommand completions" -s h -l help -d 'Print help' | 80 | complete -c rsp -n "__fish_rsp_using_subcommand completions" -s h -l help -d 'Print help' |
| 88 | complete -c rsp -n "__fish_rsp_using_subcommand help; and not __fish_seen_subcommand_from start stop restart play pause resume toggle stop-playback next previous volume shuffle queue status scan settings completions help" -f -a "start" -d 'Start the daemon' | 81 | complete -c rsp -n "__fish_rsp_using_subcommand help; and not __fish_seen_subcommand_from start-daemon stop-daemon restart play pause resume toggle stop next previous volume shuffle queue status scan settings completions help" -f -a "start-daemon" -d 'Start the daemon' |
| 89 | complete -c rsp -n "__fish_rsp_using_subcommand help; and not __fish_seen_subcommand_from start stop restart play pause resume toggle stop-playback next previous volume shuffle queue status scan settings completions help" -f -a "stop" -d 'Stop the daemon' | 82 | complete -c rsp -n "__fish_rsp_using_subcommand help; and not __fish_seen_subcommand_from start-daemon stop-daemon restart play pause resume toggle stop next previous volume shuffle queue status scan settings completions help" -f -a "stop-daemon" -d 'Stop the daemon' |
| 90 | complete -c rsp -n "__fish_rsp_using_subcommand help; and not __fish_seen_subcommand_from start stop restart play pause resume toggle stop-playback next previous volume shuffle queue status scan settings completions help" -f -a "restart" -d 'Restart the daemon (kill existing and start new)' | 83 | complete -c rsp -n "__fish_rsp_using_subcommand help; and not __fish_seen_subcommand_from start-daemon stop-daemon restart play pause resume toggle stop next previous volume shuffle queue status scan settings completions help" -f -a "restart" -d 'Restart the daemon (kill existing and start new)' |
| 91 | complete -c rsp -n "__fish_rsp_using_subcommand help; and not __fish_seen_subcommand_from start stop restart play pause resume toggle stop-playback next previous volume shuffle queue status scan settings completions help" -f -a "play" -d 'Play a track, album, or artist' | 84 | complete -c rsp -n "__fish_rsp_using_subcommand help; and not __fish_seen_subcommand_from start-daemon stop-daemon restart play pause resume toggle stop next previous volume shuffle queue status scan settings completions help" -f -a "play" -d 'Play a track, album, or artist' |
| 92 | complete -c rsp -n "__fish_rsp_using_subcommand help; and not __fish_seen_subcommand_from start stop restart play pause resume toggle stop-playback next previous volume shuffle queue status scan settings completions help" -f -a "pause" -d 'Pause playback' | 85 | complete -c rsp -n "__fish_rsp_using_subcommand help; and not __fish_seen_subcommand_from start-daemon stop-daemon restart play pause resume toggle stop next previous volume shuffle queue status scan settings completions help" -f -a "pause" -d 'Pause playback' |
| 93 | complete -c rsp -n "__fish_rsp_using_subcommand help; and not __fish_seen_subcommand_from start stop restart play pause resume toggle stop-playback next previous volume shuffle queue status scan settings completions help" -f -a "resume" -d 'Resume playback' | 86 | complete -c rsp -n "__fish_rsp_using_subcommand help; and not __fish_seen_subcommand_from start-daemon stop-daemon restart play pause resume toggle stop next previous volume shuffle queue status scan settings completions help" -f -a "resume" -d 'Resume playback' |
| 94 | complete -c rsp -n "__fish_rsp_using_subcommand help; and not __fish_seen_subcommand_from start stop restart play pause resume toggle stop-playback next previous volume shuffle queue status scan settings completions help" -f -a "toggle" -d 'Toggle play/pause' | 87 | complete -c rsp -n "__fish_rsp_using_subcommand help; and not __fish_seen_subcommand_from start-daemon stop-daemon restart play pause resume toggle stop next previous volume shuffle queue status scan settings completions help" -f -a "toggle" -d 'Toggle play/pause' |
| 95 | complete -c rsp -n "__fish_rsp_using_subcommand help; and not __fish_seen_subcommand_from start stop restart play pause resume toggle stop-playback next previous volume shuffle queue status scan settings completions help" -f -a "stop-playback" -d 'Stop playback' | 88 | complete -c rsp -n "__fish_rsp_using_subcommand help; and not __fish_seen_subcommand_from start-daemon stop-daemon restart play pause resume toggle stop next previous volume shuffle queue status scan settings completions help" -f -a "stop" -d 'Stop playback' |
| 96 | complete -c rsp -n "__fish_rsp_using_subcommand help; and not __fish_seen_subcommand_from start stop restart play pause resume toggle stop-playback next previous volume shuffle queue status scan settings completions help" -f -a "next" -d 'Skip to next track' | 89 | complete -c rsp -n "__fish_rsp_using_subcommand help; and not __fish_seen_subcommand_from start-daemon stop-daemon restart play pause resume toggle stop next previous volume shuffle queue status scan settings completions help" -f -a "next" -d 'Skip to next track' |
| 97 | complete -c rsp -n "__fish_rsp_using_subcommand help; and not __fish_seen_subcommand_from start stop restart play pause resume toggle stop-playback next previous volume shuffle queue status scan settings completions help" -f -a "previous" -d 'Skip to previous track' | 90 | complete -c rsp -n "__fish_rsp_using_subcommand help; and not __fish_seen_subcommand_from start-daemon stop-daemon restart play pause resume toggle stop next previous volume shuffle queue status scan settings completions help" -f -a "previous" -d 'Skip to previous track' |
| 98 | complete -c rsp -n "__fish_rsp_using_subcommand help; and not __fish_seen_subcommand_from start stop restart play pause resume toggle stop-playback next previous volume shuffle queue status scan settings completions help" -f -a "volume" -d 'Set volume (0-100)' | 91 | complete -c rsp -n "__fish_rsp_using_subcommand help; and not __fish_seen_subcommand_from start-daemon stop-daemon restart play pause resume toggle stop next previous volume shuffle queue status scan settings completions help" -f -a "volume" -d 'Set volume (0-100)' |
| 99 | complete -c rsp -n "__fish_rsp_using_subcommand help; and not __fish_seen_subcommand_from start stop restart play pause resume toggle stop-playback next previous volume shuffle queue status scan settings completions help" -f -a "shuffle" -d 'Shuffle mode' | 92 | complete -c rsp -n "__fish_rsp_using_subcommand help; and not __fish_seen_subcommand_from start-daemon stop-daemon restart play pause resume toggle stop next previous volume shuffle queue status scan settings completions help" -f -a "shuffle" -d 'Shuffle mode' |
| 100 | complete -c rsp -n "__fish_rsp_using_subcommand help; and not __fish_seen_subcommand_from start stop restart play pause resume toggle stop-playback next previous volume shuffle queue status scan settings completions help" -f -a "queue" -d 'Queue management' | 93 | complete -c rsp -n "__fish_rsp_using_subcommand help; and not __fish_seen_subcommand_from start-daemon stop-daemon restart play pause resume toggle stop next previous volume shuffle queue status scan settings completions help" -f -a "queue" -d 'Queue management' |
| 101 | complete -c rsp -n "__fish_rsp_using_subcommand help; and not __fish_seen_subcommand_from start stop restart play pause resume toggle stop-playback next previous volume shuffle queue status scan settings completions help" -f -a "status" -d 'Show player status' | 94 | complete -c rsp -n "__fish_rsp_using_subcommand help; and not __fish_seen_subcommand_from start-daemon stop-daemon restart play pause resume toggle stop next previous volume shuffle queue status scan settings completions help" -f -a "status" -d 'Show player status' |
| 102 | complete -c rsp -n "__fish_rsp_using_subcommand help; and not __fish_seen_subcommand_from start stop restart play pause resume toggle stop-playback next previous volume shuffle queue status scan settings completions help" -f -a "scan" -d 'Scan music paths to populate database' | 95 | complete -c rsp -n "__fish_rsp_using_subcommand help; and not __fish_seen_subcommand_from start-daemon stop-daemon restart play pause resume toggle stop next previous volume shuffle queue status scan settings completions help" -f -a "scan" -d 'Scan music paths to populate database' |
| 103 | complete -c rsp -n "__fish_rsp_using_subcommand help; and not __fish_seen_subcommand_from start stop restart play pause resume toggle stop-playback next previous volume shuffle queue status scan settings completions help" -f -a "settings" -d 'Settings management' | 96 | complete -c rsp -n "__fish_rsp_using_subcommand help; and not __fish_seen_subcommand_from start-daemon stop-daemon restart play pause resume toggle stop next previous volume shuffle queue status scan settings completions help" -f -a "settings" -d 'Settings management' |
| 104 | complete -c rsp -n "__fish_rsp_using_subcommand help; and not __fish_seen_subcommand_from start stop restart play pause resume toggle stop-playback next previous volume shuffle queue status scan settings completions help" -f -a "completions" -d 'Generate shell completions and write to completions/ directory (bash, elvish, fish, powershell, zsh)' | 97 | complete -c rsp -n "__fish_rsp_using_subcommand help; and not __fish_seen_subcommand_from start-daemon stop-daemon restart play pause resume toggle stop next previous volume shuffle queue status scan settings completions help" -f -a "completions" -d 'Generate shell completions (developer only)' |
| 105 | complete -c rsp -n "__fish_rsp_using_subcommand help; and not __fish_seen_subcommand_from start stop restart play pause resume toggle stop-playback next previous volume shuffle queue status scan settings completions help" -f -a "help" -d 'Print this message or the help of the given subcommand(s)' | 98 | complete -c rsp -n "__fish_rsp_using_subcommand help; and not __fish_seen_subcommand_from start-daemon stop-daemon restart play pause resume toggle stop next previous volume shuffle queue status scan settings completions help" -f -a "help" -d 'Print this message or the help of the given subcommand(s)' |
| 106 | complete -c rsp -n "__fish_rsp_using_subcommand help; and __fish_seen_subcommand_from settings" -f -a "get" -d 'Get a setting value' | 99 | complete -c rsp -n "__fish_rsp_using_subcommand help; and __fish_seen_subcommand_from settings" -f -a "get" -d 'Get a setting value' |
| 107 | complete -c rsp -n "__fish_rsp_using_subcommand help; and __fish_seen_subcommand_from settings" -f -a "set" -d 'Set a setting value' | 100 | complete -c rsp -n "__fish_rsp_using_subcommand help; and __fish_seen_subcommand_from settings" -f -a "set" -d 'Set a setting value' |
| 108 | complete -c rsp -n "__fish_rsp_using_subcommand help; and __fish_seen_subcommand_from settings" -f -a "list" -d 'List all settings' | 101 | complete -c rsp -n "__fish_rsp_using_subcommand help; and __fish_seen_subcommand_from settings" -f -a "list" -d 'List all settings' |
diff --git a/completions/rsp.powershell b/completions/rsp.powershell new file mode 100644 index 0000000..58db681 --- /dev/null +++ b/completions/rsp.powershell | |||
| @@ -0,0 +1,280 @@ | |||
| 1 | |||
| 2 | using namespace System.Management.Automation | ||
| 3 | using namespace System.Management.Automation.Language | ||
| 4 | |||
| 5 | Register-ArgumentCompleter -Native -CommandName 'rsp' -ScriptBlock { | ||
| 6 | param($wordToComplete, $commandAst, $cursorPosition) | ||
| 7 | |||
| 8 | $commandElements = $commandAst.CommandElements | ||
| 9 | $command = @( | ||
| 10 | 'rsp' | ||
| 11 | for ($i = 1; $i -lt $commandElements.Count; $i++) { | ||
| 12 | $element = $commandElements[$i] | ||
| 13 | if ($element -isnot [StringConstantExpressionAst] -or | ||
| 14 | $element.StringConstantType -ne [StringConstantType]::BareWord -or | ||
| 15 | $element.Value.StartsWith('-') -or | ||
| 16 | $element.Value -eq $wordToComplete) { | ||
| 17 | break | ||
| 18 | } | ||
| 19 | $element.Value | ||
| 20 | }) -join ';' | ||
| 21 | |||
| 22 | $completions = @(switch ($command) { | ||
| 23 | 'rsp' { | ||
| 24 | [CompletionResult]::new('-h', '-h', [CompletionResultType]::ParameterName, 'Print help') | ||
| 25 | [CompletionResult]::new('--help', '--help', [CompletionResultType]::ParameterName, 'Print help') | ||
| 26 | [CompletionResult]::new('start-daemon', 'start-daemon', [CompletionResultType]::ParameterValue, 'Start the daemon') | ||
| 27 | [CompletionResult]::new('stop-daemon', 'stop-daemon', [CompletionResultType]::ParameterValue, 'Stop the daemon') | ||
| 28 | [CompletionResult]::new('restart', 'restart', [CompletionResultType]::ParameterValue, 'Restart the daemon (kill existing and start new)') | ||
| 29 | [CompletionResult]::new('play', 'play', [CompletionResultType]::ParameterValue, 'Play a track, album, or artist') | ||
| 30 | [CompletionResult]::new('pause', 'pause', [CompletionResultType]::ParameterValue, 'Pause playback') | ||
| 31 | [CompletionResult]::new('resume', 'resume', [CompletionResultType]::ParameterValue, 'Resume playback') | ||
| 32 | [CompletionResult]::new('toggle', 'toggle', [CompletionResultType]::ParameterValue, 'Toggle play/pause') | ||
| 33 | [CompletionResult]::new('stop', 'stop', [CompletionResultType]::ParameterValue, 'Stop playback') | ||
| 34 | [CompletionResult]::new('next', 'next', [CompletionResultType]::ParameterValue, 'Skip to next track') | ||
| 35 | [CompletionResult]::new('previous', 'previous', [CompletionResultType]::ParameterValue, 'Skip to previous track') | ||
| 36 | [CompletionResult]::new('volume', 'volume', [CompletionResultType]::ParameterValue, 'Set volume (0-100)') | ||
| 37 | [CompletionResult]::new('shuffle', 'shuffle', [CompletionResultType]::ParameterValue, 'Shuffle mode') | ||
| 38 | [CompletionResult]::new('queue', 'queue', [CompletionResultType]::ParameterValue, 'Queue management') | ||
| 39 | [CompletionResult]::new('status', 'status', [CompletionResultType]::ParameterValue, 'Show player status') | ||
| 40 | [CompletionResult]::new('scan', 'scan', [CompletionResultType]::ParameterValue, 'Scan music paths to populate database') | ||
| 41 | [CompletionResult]::new('settings', 'settings', [CompletionResultType]::ParameterValue, 'Settings management') | ||
| 42 | [CompletionResult]::new('completions', 'completions', [CompletionResultType]::ParameterValue, 'Generate shell completions (developer only)') | ||
| 43 | [CompletionResult]::new('help', 'help', [CompletionResultType]::ParameterValue, 'Print this message or the help of the given subcommand(s)') | ||
| 44 | break | ||
| 45 | } | ||
| 46 | 'rsp;start-daemon' { | ||
| 47 | [CompletionResult]::new('-h', '-h', [CompletionResultType]::ParameterName, 'Print help') | ||
| 48 | [CompletionResult]::new('--help', '--help', [CompletionResultType]::ParameterName, 'Print help') | ||
| 49 | break | ||
| 50 | } | ||
| 51 | 'rsp;stop-daemon' { | ||
| 52 | [CompletionResult]::new('-h', '-h', [CompletionResultType]::ParameterName, 'Print help') | ||
| 53 | [CompletionResult]::new('--help', '--help', [CompletionResultType]::ParameterName, 'Print help') | ||
| 54 | break | ||
| 55 | } | ||
| 56 | 'rsp;restart' { | ||
| 57 | [CompletionResult]::new('-h', '-h', [CompletionResultType]::ParameterName, 'Print help') | ||
| 58 | [CompletionResult]::new('--help', '--help', [CompletionResultType]::ParameterName, 'Print help') | ||
| 59 | break | ||
| 60 | } | ||
| 61 | 'rsp;play' { | ||
| 62 | [CompletionResult]::new('-i', '-i', [CompletionResultType]::ParameterName, 'Add after current track and skip to it') | ||
| 63 | [CompletionResult]::new('--now', '--now', [CompletionResultType]::ParameterName, 'Add after current track and skip to it') | ||
| 64 | [CompletionResult]::new('-n', '-n', [CompletionResultType]::ParameterName, 'Add to queue after current track (don''t skip)') | ||
| 65 | [CompletionResult]::new('--next', '--next', [CompletionResultType]::ParameterName, 'Add to queue after current track (don''t skip)') | ||
| 66 | [CompletionResult]::new('-h', '-h', [CompletionResultType]::ParameterName, 'Print help') | ||
| 67 | [CompletionResult]::new('--help', '--help', [CompletionResultType]::ParameterName, 'Print help') | ||
| 68 | break | ||
| 69 | } | ||
| 70 | 'rsp;pause' { | ||
| 71 | [CompletionResult]::new('-h', '-h', [CompletionResultType]::ParameterName, 'Print help') | ||
| 72 | [CompletionResult]::new('--help', '--help', [CompletionResultType]::ParameterName, 'Print help') | ||
| 73 | break | ||
| 74 | } | ||
| 75 | 'rsp;resume' { | ||
| 76 | [CompletionResult]::new('-h', '-h', [CompletionResultType]::ParameterName, 'Print help') | ||
| 77 | [CompletionResult]::new('--help', '--help', [CompletionResultType]::ParameterName, 'Print help') | ||
| 78 | break | ||
| 79 | } | ||
| 80 | 'rsp;toggle' { | ||
| 81 | [CompletionResult]::new('-h', '-h', [CompletionResultType]::ParameterName, 'Print help') | ||
| 82 | [CompletionResult]::new('--help', '--help', [CompletionResultType]::ParameterName, 'Print help') | ||
| 83 | break | ||
| 84 | } | ||
| 85 | 'rsp;stop' { | ||
| 86 | [CompletionResult]::new('-h', '-h', [CompletionResultType]::ParameterName, 'Print help') | ||
| 87 | [CompletionResult]::new('--help', '--help', [CompletionResultType]::ParameterName, 'Print help') | ||
| 88 | break | ||
| 89 | } | ||
| 90 | 'rsp;next' { | ||
| 91 | [CompletionResult]::new('-h', '-h', [CompletionResultType]::ParameterName, 'Print help') | ||
| 92 | [CompletionResult]::new('--help', '--help', [CompletionResultType]::ParameterName, 'Print help') | ||
| 93 | break | ||
| 94 | } | ||
| 95 | 'rsp;previous' { | ||
| 96 | [CompletionResult]::new('-h', '-h', [CompletionResultType]::ParameterName, 'Print help') | ||
| 97 | [CompletionResult]::new('--help', '--help', [CompletionResultType]::ParameterName, 'Print help') | ||
| 98 | break | ||
| 99 | } | ||
| 100 | 'rsp;volume' { | ||
| 101 | [CompletionResult]::new('-h', '-h', [CompletionResultType]::ParameterName, 'Print help') | ||
| 102 | [CompletionResult]::new('--help', '--help', [CompletionResultType]::ParameterName, 'Print help') | ||
| 103 | break | ||
| 104 | } | ||
| 105 | 'rsp;shuffle' { | ||
| 106 | [CompletionResult]::new('-h', '-h', [CompletionResultType]::ParameterName, 'Print help') | ||
| 107 | [CompletionResult]::new('--help', '--help', [CompletionResultType]::ParameterName, 'Print help') | ||
| 108 | break | ||
| 109 | } | ||
| 110 | 'rsp;queue' { | ||
| 111 | [CompletionResult]::new('-h', '-h', [CompletionResultType]::ParameterName, 'Print help') | ||
| 112 | [CompletionResult]::new('--help', '--help', [CompletionResultType]::ParameterName, 'Print help') | ||
| 113 | break | ||
| 114 | } | ||
| 115 | 'rsp;status' { | ||
| 116 | [CompletionResult]::new('-h', '-h', [CompletionResultType]::ParameterName, 'Print help') | ||
| 117 | [CompletionResult]::new('--help', '--help', [CompletionResultType]::ParameterName, 'Print help') | ||
| 118 | break | ||
| 119 | } | ||
| 120 | 'rsp;scan' { | ||
| 121 | [CompletionResult]::new('--paths', '--paths', [CompletionResultType]::ParameterName, 'paths') | ||
| 122 | [CompletionResult]::new('--force', '--force', [CompletionResultType]::ParameterName, 'force') | ||
| 123 | [CompletionResult]::new('-h', '-h', [CompletionResultType]::ParameterName, 'Print help') | ||
| 124 | [CompletionResult]::new('--help', '--help', [CompletionResultType]::ParameterName, 'Print help') | ||
| 125 | break | ||
| 126 | } | ||
| 127 | 'rsp;settings' { | ||
| 128 | [CompletionResult]::new('-h', '-h', [CompletionResultType]::ParameterName, 'Print help') | ||
| 129 | [CompletionResult]::new('--help', '--help', [CompletionResultType]::ParameterName, 'Print help') | ||
| 130 | [CompletionResult]::new('get', 'get', [CompletionResultType]::ParameterValue, 'Get a setting value') | ||
| 131 | [CompletionResult]::new('set', 'set', [CompletionResultType]::ParameterValue, 'Set a setting value') | ||
| 132 | [CompletionResult]::new('list', 'list', [CompletionResultType]::ParameterValue, 'List all settings') | ||
| 133 | [CompletionResult]::new('unset', 'unset', [CompletionResultType]::ParameterValue, 'Unset a setting') | ||
| 134 | [CompletionResult]::new('help', 'help', [CompletionResultType]::ParameterValue, 'Print this message or the help of the given subcommand(s)') | ||
| 135 | break | ||
| 136 | } | ||
| 137 | 'rsp;settings;get' { | ||
| 138 | [CompletionResult]::new('-h', '-h', [CompletionResultType]::ParameterName, 'Print help') | ||
| 139 | [CompletionResult]::new('--help', '--help', [CompletionResultType]::ParameterName, 'Print help') | ||
| 140 | break | ||
| 141 | } | ||
| 142 | 'rsp;settings;set' { | ||
| 143 | [CompletionResult]::new('-h', '-h', [CompletionResultType]::ParameterName, 'Print help') | ||
| 144 | [CompletionResult]::new('--help', '--help', [CompletionResultType]::ParameterName, 'Print help') | ||
| 145 | break | ||
| 146 | } | ||
| 147 | 'rsp;settings;list' { | ||
| 148 | [CompletionResult]::new('-h', '-h', [CompletionResultType]::ParameterName, 'Print help') | ||
| 149 | [CompletionResult]::new('--help', '--help', [CompletionResultType]::ParameterName, 'Print help') | ||
| 150 | break | ||
| 151 | } | ||
| 152 | 'rsp;settings;unset' { | ||
| 153 | [CompletionResult]::new('-h', '-h', [CompletionResultType]::ParameterName, 'Print help') | ||
| 154 | [CompletionResult]::new('--help', '--help', [CompletionResultType]::ParameterName, 'Print help') | ||
| 155 | break | ||
| 156 | } | ||
| 157 | 'rsp;settings;help' { | ||
| 158 | [CompletionResult]::new('get', 'get', [CompletionResultType]::ParameterValue, 'Get a setting value') | ||
| 159 | [CompletionResult]::new('set', 'set', [CompletionResultType]::ParameterValue, 'Set a setting value') | ||
| 160 | [CompletionResult]::new('list', 'list', [CompletionResultType]::ParameterValue, 'List all settings') | ||
| 161 | [CompletionResult]::new('unset', 'unset', [CompletionResultType]::ParameterValue, 'Unset a setting') | ||
| 162 | [CompletionResult]::new('help', 'help', [CompletionResultType]::ParameterValue, 'Print this message or the help of the given subcommand(s)') | ||
| 163 | break | ||
| 164 | } | ||
| 165 | 'rsp;settings;help;get' { | ||
| 166 | break | ||
| 167 | } | ||
| 168 | 'rsp;settings;help;set' { | ||
| 169 | break | ||
| 170 | } | ||
| 171 | 'rsp;settings;help;list' { | ||
| 172 | break | ||
| 173 | } | ||
| 174 | 'rsp;settings;help;unset' { | ||
| 175 | break | ||
| 176 | } | ||
| 177 | 'rsp;settings;help;help' { | ||
| 178 | break | ||
| 179 | } | ||
| 180 | 'rsp;completions' { | ||
| 181 | [CompletionResult]::new('-h', '-h', [CompletionResultType]::ParameterName, 'Print help') | ||
| 182 | [CompletionResult]::new('--help', '--help', [CompletionResultType]::ParameterName, 'Print help') | ||
| 183 | break | ||
| 184 | } | ||
| 185 | 'rsp;help' { | ||
| 186 | [CompletionResult]::new('start-daemon', 'start-daemon', [CompletionResultType]::ParameterValue, 'Start the daemon') | ||
| 187 | [CompletionResult]::new('stop-daemon', 'stop-daemon', [CompletionResultType]::ParameterValue, 'Stop the daemon') | ||
| 188 | [CompletionResult]::new('restart', 'restart', [CompletionResultType]::ParameterValue, 'Restart the daemon (kill existing and start new)') | ||
| 189 | [CompletionResult]::new('play', 'play', [CompletionResultType]::ParameterValue, 'Play a track, album, or artist') | ||
| 190 | [CompletionResult]::new('pause', 'pause', [CompletionResultType]::ParameterValue, 'Pause playback') | ||
| 191 | [CompletionResult]::new('resume', 'resume', [CompletionResultType]::ParameterValue, 'Resume playback') | ||
| 192 | [CompletionResult]::new('toggle', 'toggle', [CompletionResultType]::ParameterValue, 'Toggle play/pause') | ||
| 193 | [CompletionResult]::new('stop', 'stop', [CompletionResultType]::ParameterValue, 'Stop playback') | ||
| 194 | [CompletionResult]::new('next', 'next', [CompletionResultType]::ParameterValue, 'Skip to next track') | ||
| 195 | [CompletionResult]::new('previous', 'previous', [CompletionResultType]::ParameterValue, 'Skip to previous track') | ||
| 196 | [CompletionResult]::new('volume', 'volume', [CompletionResultType]::ParameterValue, 'Set volume (0-100)') | ||
| 197 | [CompletionResult]::new('shuffle', 'shuffle', [CompletionResultType]::ParameterValue, 'Shuffle mode') | ||
| 198 | [CompletionResult]::new('queue', 'queue', [CompletionResultType]::ParameterValue, 'Queue management') | ||
| 199 | [CompletionResult]::new('status', 'status', [CompletionResultType]::ParameterValue, 'Show player status') | ||
| 200 | [CompletionResult]::new('scan', 'scan', [CompletionResultType]::ParameterValue, 'Scan music paths to populate database') | ||
| 201 | [CompletionResult]::new('settings', 'settings', [CompletionResultType]::ParameterValue, 'Settings management') | ||
| 202 | [CompletionResult]::new('completions', 'completions', [CompletionResultType]::ParameterValue, 'Generate shell completions (developer only)') | ||
| 203 | [CompletionResult]::new('help', 'help', [CompletionResultType]::ParameterValue, 'Print this message or the help of the given subcommand(s)') | ||
| 204 | break | ||
| 205 | } | ||
| 206 | 'rsp;help;start-daemon' { | ||
| 207 | break | ||
| 208 | } | ||
| 209 | 'rsp;help;stop-daemon' { | ||
| 210 | break | ||
| 211 | } | ||
| 212 | 'rsp;help;restart' { | ||
| 213 | break | ||
| 214 | } | ||
| 215 | 'rsp;help;play' { | ||
| 216 | break | ||
| 217 | } | ||
| 218 | 'rsp;help;pause' { | ||
| 219 | break | ||
| 220 | } | ||
| 221 | 'rsp;help;resume' { | ||
| 222 | break | ||
| 223 | } | ||
| 224 | 'rsp;help;toggle' { | ||
| 225 | break | ||
| 226 | } | ||
| 227 | 'rsp;help;stop' { | ||
| 228 | break | ||
| 229 | } | ||
| 230 | 'rsp;help;next' { | ||
| 231 | break | ||
| 232 | } | ||
| 233 | 'rsp;help;previous' { | ||
| 234 | break | ||
| 235 | } | ||
| 236 | 'rsp;help;volume' { | ||
| 237 | break | ||
| 238 | } | ||
| 239 | 'rsp;help;shuffle' { | ||
| 240 | break | ||
| 241 | } | ||
| 242 | 'rsp;help;queue' { | ||
| 243 | break | ||
| 244 | } | ||
| 245 | 'rsp;help;status' { | ||
| 246 | break | ||
| 247 | } | ||
| 248 | 'rsp;help;scan' { | ||
| 249 | break | ||
| 250 | } | ||
| 251 | 'rsp;help;settings' { | ||
| 252 | [CompletionResult]::new('get', 'get', [CompletionResultType]::ParameterValue, 'Get a setting value') | ||
| 253 | [CompletionResult]::new('set', 'set', [CompletionResultType]::ParameterValue, 'Set a setting value') | ||
| 254 | [CompletionResult]::new('list', 'list', [CompletionResultType]::ParameterValue, 'List all settings') | ||
| 255 | [CompletionResult]::new('unset', 'unset', [CompletionResultType]::ParameterValue, 'Unset a setting') | ||
| 256 | break | ||
| 257 | } | ||
| 258 | 'rsp;help;settings;get' { | ||
| 259 | break | ||
| 260 | } | ||
| 261 | 'rsp;help;settings;set' { | ||
| 262 | break | ||
| 263 | } | ||
| 264 | 'rsp;help;settings;list' { | ||
| 265 | break | ||
| 266 | } | ||
| 267 | 'rsp;help;settings;unset' { | ||
| 268 | break | ||
| 269 | } | ||
| 270 | 'rsp;help;completions' { | ||
| 271 | break | ||
| 272 | } | ||
| 273 | 'rsp;help;help' { | ||
| 274 | break | ||
| 275 | } | ||
| 276 | }) | ||
| 277 | |||
| 278 | $completions.Where{ $_.CompletionText -like "$wordToComplete*" } | | ||
| 279 | Sort-Object -Property ListItemText | ||
| 280 | } | ||
diff --git a/completions/rsp.zsh b/completions/rsp.zsh index d635e3c..e8da3d7 100644 --- a/completions/rsp.zsh +++ b/completions/rsp.zsh | |||
| @@ -26,13 +26,13 @@ _rsp() { | |||
| 26 | (( CURRENT += 1 )) | 26 | (( CURRENT += 1 )) |
| 27 | curcontext="${curcontext%:*:*}:rsp-command-$line[1]:" | 27 | curcontext="${curcontext%:*:*}:rsp-command-$line[1]:" |
| 28 | case $line[1] in | 28 | case $line[1] in |
| 29 | (start) | 29 | (start-daemon) |
| 30 | _arguments "${_arguments_options[@]}" : \ | 30 | _arguments "${_arguments_options[@]}" : \ |
| 31 | '-h[Print help]' \ | 31 | '-h[Print help]' \ |
| 32 | '--help[Print help]' \ | 32 | '--help[Print help]' \ |
| 33 | && ret=0 | 33 | && ret=0 |
| 34 | ;; | 34 | ;; |
| 35 | (stop) | 35 | (stop-daemon) |
| 36 | _arguments "${_arguments_options[@]}" : \ | 36 | _arguments "${_arguments_options[@]}" : \ |
| 37 | '-h[Print help]' \ | 37 | '-h[Print help]' \ |
| 38 | '--help[Print help]' \ | 38 | '--help[Print help]' \ |
| @@ -46,17 +46,13 @@ _arguments "${_arguments_options[@]}" : \ | |||
| 46 | ;; | 46 | ;; |
| 47 | (play) | 47 | (play) |
| 48 | _arguments "${_arguments_options[@]}" : \ | 48 | _arguments "${_arguments_options[@]}" : \ |
| 49 | '-i[Play immediately (add after current and skip to it)]' \ | 49 | '-i[Add after current track and skip to it]' \ |
| 50 | '--now[Play immediately (add after current and skip to it)]' \ | 50 | '--now[Add after current track and skip to it]' \ |
| 51 | '-n[Add to queue after current track (don'\''t skip)]' \ | 51 | '-n[Add to queue after current track (don'\''t skip)]' \ |
| 52 | '--next[Add to queue after current track (don'\''t skip)]' \ | 52 | '--next[Add to queue after current track (don'\''t skip)]' \ |
| 53 | '-l[Add to end of queue (default)]' \ | ||
| 54 | '--last[Add to end of queue (default)]' \ | ||
| 55 | '-L[List available artists/albums]' \ | ||
| 56 | '--list[List available artists/albums]' \ | ||
| 57 | '-h[Print help]' \ | 53 | '-h[Print help]' \ |
| 58 | '--help[Print help]' \ | 54 | '--help[Print help]' \ |
| 59 | '::query -- Artist/Album or local file path:_rsp_play_artist_album_completion' \ | 55 | '::query:_default' \ |
| 60 | && ret=0 | 56 | && ret=0 |
| 61 | ;; | 57 | ;; |
| 62 | (pause) | 58 | (pause) |
| @@ -77,7 +73,7 @@ _arguments "${_arguments_options[@]}" : \ | |||
| 77 | '--help[Print help]' \ | 73 | '--help[Print help]' \ |
| 78 | && ret=0 | 74 | && ret=0 |
| 79 | ;; | 75 | ;; |
| 80 | (stop-playback) | 76 | (stop) |
| 81 | _arguments "${_arguments_options[@]}" : \ | 77 | _arguments "${_arguments_options[@]}" : \ |
| 82 | '-h[Print help]' \ | 78 | '-h[Print help]' \ |
| 83 | '--help[Print help]' \ | 79 | '--help[Print help]' \ |
| @@ -215,9 +211,9 @@ esac | |||
| 215 | ;; | 211 | ;; |
| 216 | (completions) | 212 | (completions) |
| 217 | _arguments "${_arguments_options[@]}" : \ | 213 | _arguments "${_arguments_options[@]}" : \ |
| 218 | '--shell=[Also print to stdout for a specific shell]:SHELL:(bash elvish fish powershell zsh)' \ | ||
| 219 | '-h[Print help]' \ | 214 | '-h[Print help]' \ |
| 220 | '--help[Print help]' \ | 215 | '--help[Print help]' \ |
| 216 | '::shell -- Shell to generate (bash, zsh, fish, elvish, powershell) If not specified, generates all completion files:_default' \ | ||
| 221 | && ret=0 | 217 | && ret=0 |
| 222 | ;; | 218 | ;; |
| 223 | (help) | 219 | (help) |
| @@ -232,11 +228,11 @@ _arguments "${_arguments_options[@]}" : \ | |||
| 232 | (( CURRENT += 1 )) | 228 | (( CURRENT += 1 )) |
| 233 | curcontext="${curcontext%:*:*}:rsp-help-command-$line[1]:" | 229 | curcontext="${curcontext%:*:*}:rsp-help-command-$line[1]:" |
| 234 | case $line[1] in | 230 | case $line[1] in |
| 235 | (start) | 231 | (start-daemon) |
| 236 | _arguments "${_arguments_options[@]}" : \ | 232 | _arguments "${_arguments_options[@]}" : \ |
| 237 | && ret=0 | 233 | && ret=0 |
| 238 | ;; | 234 | ;; |
| 239 | (stop) | 235 | (stop-daemon) |
| 240 | _arguments "${_arguments_options[@]}" : \ | 236 | _arguments "${_arguments_options[@]}" : \ |
| 241 | && ret=0 | 237 | && ret=0 |
| 242 | ;; | 238 | ;; |
| @@ -260,7 +256,7 @@ _arguments "${_arguments_options[@]}" : \ | |||
| 260 | _arguments "${_arguments_options[@]}" : \ | 256 | _arguments "${_arguments_options[@]}" : \ |
| 261 | && ret=0 | 257 | && ret=0 |
| 262 | ;; | 258 | ;; |
| 263 | (stop-playback) | 259 | (stop) |
| 264 | _arguments "${_arguments_options[@]}" : \ | 260 | _arguments "${_arguments_options[@]}" : \ |
| 265 | && ret=0 | 261 | && ret=0 |
| 266 | ;; | 262 | ;; |
| @@ -344,14 +340,14 @@ esac | |||
| 344 | (( $+functions[_rsp_commands] )) || | 340 | (( $+functions[_rsp_commands] )) || |
| 345 | _rsp_commands() { | 341 | _rsp_commands() { |
| 346 | local commands; commands=( | 342 | local commands; commands=( |
| 347 | 'start:Start the daemon' \ | 343 | 'start-daemon:Start the daemon' \ |
| 348 | 'stop:Stop the daemon' \ | 344 | 'stop-daemon:Stop the daemon' \ |
| 349 | 'restart:Restart the daemon (kill existing and start new)' \ | 345 | 'restart:Restart the daemon (kill existing and start new)' \ |
| 350 | 'play:Play a track, album, or artist' \ | 346 | 'play:Play a track, album, or artist' \ |
| 351 | 'pause:Pause playback' \ | 347 | 'pause:Pause playback' \ |
| 352 | 'resume:Resume playback' \ | 348 | 'resume:Resume playback' \ |
| 353 | 'toggle:Toggle play/pause' \ | 349 | 'toggle:Toggle play/pause' \ |
| 354 | 'stop-playback:Stop playback' \ | 350 | 'stop:Stop playback' \ |
| 355 | 'next:Skip to next track' \ | 351 | 'next:Skip to next track' \ |
| 356 | 'previous:Skip to previous track' \ | 352 | 'previous:Skip to previous track' \ |
| 357 | 'volume:Set volume (0-100)' \ | 353 | 'volume:Set volume (0-100)' \ |
| @@ -360,7 +356,7 @@ _rsp_commands() { | |||
| 360 | 'status:Show player status' \ | 356 | 'status:Show player status' \ |
| 361 | 'scan:Scan music paths to populate database' \ | 357 | 'scan:Scan music paths to populate database' \ |
| 362 | 'settings:Settings management' \ | 358 | 'settings:Settings management' \ |
| 363 | 'completions:Generate shell completions and write to completions/ directory (bash, elvish, fish, powershell, zsh)' \ | 359 | 'completions:Generate shell completions (developer only)' \ |
| 364 | 'help:Print this message or the help of the given subcommand(s)' \ | 360 | 'help:Print this message or the help of the given subcommand(s)' \ |
| 365 | ) | 361 | ) |
| 366 | _describe -t commands 'rsp commands' commands "$@" | 362 | _describe -t commands 'rsp commands' commands "$@" |
| @@ -373,14 +369,14 @@ _rsp__subcmd__completions_commands() { | |||
| 373 | (( $+functions[_rsp__subcmd__help_commands] )) || | 369 | (( $+functions[_rsp__subcmd__help_commands] )) || |
| 374 | _rsp__subcmd__help_commands() { | 370 | _rsp__subcmd__help_commands() { |
| 375 | local commands; commands=( | 371 | local commands; commands=( |
| 376 | 'start:Start the daemon' \ | 372 | 'start-daemon:Start the daemon' \ |
| 377 | 'stop:Stop the daemon' \ | 373 | 'stop-daemon:Stop the daemon' \ |
| 378 | 'restart:Restart the daemon (kill existing and start new)' \ | 374 | 'restart:Restart the daemon (kill existing and start new)' \ |
| 379 | 'play:Play a track, album, or artist' \ | 375 | 'play:Play a track, album, or artist' \ |
| 380 | 'pause:Pause playback' \ | 376 | 'pause:Pause playback' \ |
| 381 | 'resume:Resume playback' \ | 377 | 'resume:Resume playback' \ |
| 382 | 'toggle:Toggle play/pause' \ | 378 | 'toggle:Toggle play/pause' \ |
| 383 | 'stop-playback:Stop playback' \ | 379 | 'stop:Stop playback' \ |
| 384 | 'next:Skip to next track' \ | 380 | 'next:Skip to next track' \ |
| 385 | 'previous:Skip to previous track' \ | 381 | 'previous:Skip to previous track' \ |
| 386 | 'volume:Set volume (0-100)' \ | 382 | 'volume:Set volume (0-100)' \ |
| @@ -389,7 +385,7 @@ _rsp__subcmd__help_commands() { | |||
| 389 | 'status:Show player status' \ | 385 | 'status:Show player status' \ |
| 390 | 'scan:Scan music paths to populate database' \ | 386 | 'scan:Scan music paths to populate database' \ |
| 391 | 'settings:Settings management' \ | 387 | 'settings:Settings management' \ |
| 392 | 'completions:Generate shell completions and write to completions/ directory (bash, elvish, fish, powershell, zsh)' \ | 388 | 'completions:Generate shell completions (developer only)' \ |
| 393 | 'help:Print this message or the help of the given subcommand(s)' \ | 389 | 'help:Print this message or the help of the given subcommand(s)' \ |
| 394 | ) | 390 | ) |
| 395 | _describe -t commands 'rsp help commands' commands "$@" | 391 | _describe -t commands 'rsp help commands' commands "$@" |
| @@ -479,10 +475,10 @@ _rsp__subcmd__help__subcmd__shuffle_commands() { | |||
| 479 | local commands; commands=() | 475 | local commands; commands=() |
| 480 | _describe -t commands 'rsp help shuffle commands' commands "$@" | 476 | _describe -t commands 'rsp help shuffle commands' commands "$@" |
| 481 | } | 477 | } |
| 482 | (( $+functions[_rsp__subcmd__help__subcmd__start_commands] )) || | 478 | (( $+functions[_rsp__subcmd__help__subcmd__start-daemon_commands] )) || |
| 483 | _rsp__subcmd__help__subcmd__start_commands() { | 479 | _rsp__subcmd__help__subcmd__start-daemon_commands() { |
| 484 | local commands; commands=() | 480 | local commands; commands=() |
| 485 | _describe -t commands 'rsp help start commands' commands "$@" | 481 | _describe -t commands 'rsp help start-daemon commands' commands "$@" |
| 486 | } | 482 | } |
| 487 | (( $+functions[_rsp__subcmd__help__subcmd__status_commands] )) || | 483 | (( $+functions[_rsp__subcmd__help__subcmd__status_commands] )) || |
| 488 | _rsp__subcmd__help__subcmd__status_commands() { | 484 | _rsp__subcmd__help__subcmd__status_commands() { |
| @@ -494,10 +490,10 @@ _rsp__subcmd__help__subcmd__stop_commands() { | |||
| 494 | local commands; commands=() | 490 | local commands; commands=() |
| 495 | _describe -t commands 'rsp help stop commands' commands "$@" | 491 | _describe -t commands 'rsp help stop commands' commands "$@" |
| 496 | } | 492 | } |
| 497 | (( $+functions[_rsp__subcmd__help__subcmd__stop-playback_commands] )) || | 493 | (( $+functions[_rsp__subcmd__help__subcmd__stop-daemon_commands] )) || |
| 498 | _rsp__subcmd__help__subcmd__stop-playback_commands() { | 494 | _rsp__subcmd__help__subcmd__stop-daemon_commands() { |
| 499 | local commands; commands=() | 495 | local commands; commands=() |
| 500 | _describe -t commands 'rsp help stop-playback commands' commands "$@" | 496 | _describe -t commands 'rsp help stop-daemon commands' commands "$@" |
| 501 | } | 497 | } |
| 502 | (( $+functions[_rsp__subcmd__help__subcmd__toggle_commands] )) || | 498 | (( $+functions[_rsp__subcmd__help__subcmd__toggle_commands] )) || |
| 503 | _rsp__subcmd__help__subcmd__toggle_commands() { | 499 | _rsp__subcmd__help__subcmd__toggle_commands() { |
| @@ -621,10 +617,10 @@ _rsp__subcmd__shuffle_commands() { | |||
| 621 | local commands; commands=() | 617 | local commands; commands=() |
| 622 | _describe -t commands 'rsp shuffle commands' commands "$@" | 618 | _describe -t commands 'rsp shuffle commands' commands "$@" |
| 623 | } | 619 | } |
| 624 | (( $+functions[_rsp__subcmd__start_commands] )) || | 620 | (( $+functions[_rsp__subcmd__start-daemon_commands] )) || |
| 625 | _rsp__subcmd__start_commands() { | 621 | _rsp__subcmd__start-daemon_commands() { |
| 626 | local commands; commands=() | 622 | local commands; commands=() |
| 627 | _describe -t commands 'rsp start commands' commands "$@" | 623 | _describe -t commands 'rsp start-daemon commands' commands "$@" |
| 628 | } | 624 | } |
| 629 | (( $+functions[_rsp__subcmd__status_commands] )) || | 625 | (( $+functions[_rsp__subcmd__status_commands] )) || |
| 630 | _rsp__subcmd__status_commands() { | 626 | _rsp__subcmd__status_commands() { |
| @@ -636,10 +632,10 @@ _rsp__subcmd__stop_commands() { | |||
| 636 | local commands; commands=() | 632 | local commands; commands=() |
| 637 | _describe -t commands 'rsp stop commands' commands "$@" | 633 | _describe -t commands 'rsp stop commands' commands "$@" |
| 638 | } | 634 | } |
| 639 | (( $+functions[_rsp__subcmd__stop-playback_commands] )) || | 635 | (( $+functions[_rsp__subcmd__stop-daemon_commands] )) || |
| 640 | _rsp__subcmd__stop-playback_commands() { | 636 | _rsp__subcmd__stop-daemon_commands() { |
| 641 | local commands; commands=() | 637 | local commands; commands=() |
| 642 | _describe -t commands 'rsp stop-playback commands' commands "$@" | 638 | _describe -t commands 'rsp stop-daemon commands' commands "$@" |
| 643 | } | 639 | } |
| 644 | (( $+functions[_rsp__subcmd__toggle_commands] )) || | 640 | (( $+functions[_rsp__subcmd__toggle_commands] )) || |
| 645 | _rsp__subcmd__toggle_commands() { | 641 | _rsp__subcmd__toggle_commands() { |
| @@ -657,9 +653,3 @@ if [ "$funcstack[1]" = "_rsp" ]; then | |||
| 657 | else | 653 | else |
| 658 | compdef _rsp rsp | 654 | compdef _rsp rsp |
| 659 | fi | 655 | fi |
| 660 | |||
| 661 | _rsp_play_artist_album_completion() { | ||
| 662 | local -a artists | ||
| 663 | artists=("$(rsp play --list 2>/dev/null)") | ||
| 664 | _describe -t artist-album 'artist/album' artists | ||
| 665 | } | ||
