#compdef cmdtemp _cmdtemp() { _arguments -s -S \ "*::cmdtemp command:_list_commands" return 0 } (( $+functions[_list_commands] )) || _list_commands() { _message "`cmdtemp`" }