#compdef slidewire _slidewire() { local -a commands commands=( 'strips:list strips with volume and assignment' 'set:set or change a strip'"'"'s volume' 'mute:mute or unmute a strip' 'mic:mute or unmute the microphone' 'bank:switch to a bank' 'banks:show the current bank' 'scene:recall or save a scene' 'scenes:list scenes' 'profile:switch profile' 'profiles:list profiles' 'state:everything as JSON' ) if (( CURRENT == 2 )); then _describe 'command' commands _arguments \ '--minimized[start in the tray]' \ '--list-ports[list MIDI ports]' \ '--monitor[print incoming MIDI]:pattern:' \ '--doctor[check why a controller does not show up]:pattern:' \ '--install-icon[install a menu entry and icons]' \ '--uninstall[remove the menu entry, icons and autostart]' \ '--write-icons[write theme icons]:directory:_files -/' \ '(-V --version)'{-V,--version}'[print the version]' \ '(-h --help)'{-h,--help}'[show help]' return fi case $words[2] in mute) (( CURRENT == 4 )) && _values 'mode' on off toggle ;; mic) (( CURRENT == 3 )) && _values 'mode' on off toggle ;; scene) (( CURRENT == 3 )) && _values 'scene' save ;; set) _arguments '--volume[set the volume itself, through the strip'"'"'s range]' ;; strips|scenes|banks|profiles) _arguments '--json[print JSON]' ;; esac } _slidewire "$@"