#compdef wom _arguments \ '1:flag:->flags' \ '*:: :->args' case "$state" in flags) local -a opts opts=( '-c:Path to config file' '-v:Show version and exit' '-h:Show help text' $(wom subcmds) ) _describe 'flags' opts ;; args) case $line[1] in -c) _files ;; esac esac