anchor.diff:              "<%= flatswitches(option).first %><%= takesArg(option) %>[<%= optionDesc option %>]: :" \
             <%- end -%>
           <%- end -%>
  -      <%- end -%>
  +      <%- end %>
       ;;
       (options)
         case $line[1] in
  -      <%- for sname, cmd in subs -%>
  +      <%- for sname, ssubs in subs -%>
  +        <%- command = ssubs["\0cmd"]; subs = ssubs.reject{|k,_| k == "\0cmd"} -%>
           (<%=sname%>)
  +        <%- unless command.nil? then -%>
  +          _arguments \
  +          <%- for option in command.options -%>
  +            <%- if flatswitches(option).count > 1 -%>
  +              {<%= flatswitches(option).join(',') %>}<%= takesArg(option) %>"[<%= optionDesc option %>]: :" \
  +            <%- else -%>
  +              "<%= flatswitches(option).first %><%= takesArg(option) %>[<%= optionDesc option %>]: :" \
  +            <%- end -%>
  +          <%- end -%>
  +        <%- end %>
           ;;
         <%-end-%>
         esac
  
positive.code:         <%=sname%>:''
        <%-end-%>
        )
  			_describe -t commands 'subcommsnd' subcommands
        <%-end-%>
        <%- unless command.nil? then -%>
        _arguments \
          <%- for option in command.options -%>
  
negative.code: #compdef <%= program :name %>
  
  __<%= program :name %>_common_options=(
  <% for option in @options -%>
    <%- if flatswitches(option).count > 1 -%>
      {<%= flatswitches(option).join(',') %>}<%= takesArg(option) %>:"<%= optionDesc option %>"
    <%- else -%>
      "<%= flatswitches(option).first %><%= takesArg(option) %>:<%= optionDesc option %>"
    <%- end -%>
  <% end %>
  )
  
  _<%= program :name %> () {
      local curcontext="$curcontext" state line
      typeset -A opt_args
  
      # except this fails when a command only has one arg and then options.
      _arguments -C \
          ':command:->command' \
  