# Zsh autocomplete for mitsuba, mtsutil, and mtssrv
mitsuba_plugins=$(ls -1 "$MITSUBA_DIR/dist/plugins"| grep -oE '\w+.so'| sed 's/.so$//')
compdef "_arguments '-c[connect to host(s)]:host:_hosts' '-s[connect to list of hosts in a file]:hostfile:_files' '-o[output file]:out:_files' '*:scene:_files -g \*.\(xml\|XML\)'" mitsuba
compdef "_arguments '-c[connect to host(s)]:host:_hosts' '-s[connect to list of hosts in a file]:hostfile:_files' '1:plugins:($mitsuba_plugins)' '*:utilargs:_files'" mtsutil
compdef "_arguments '-c[connect to host(s)]:host:_hosts' '-s[connect to list of hosts in a file]:hostfile:_files'" mtssrv