#compdef dropbox if [[ CURRENT -eq 2 || $words[2] = help ]]; then local -a line progs _call_program commands command dropbox help | while read -A line; do if [[ $line[1] = [a-z]## ]]; then progs+=("$line[1]:$line[2,-1]") fi done _describe -t dropbox-commands 'Dropbox command' progs elif [[ $words[2] = (ls|filestatus|sharelink) ]]; then _files fi