anchor.diff:          <%=sname%>:''
         <%-end-%>
         )
  -			_describe -t commands 'subcommsnd' subcommands
  +			_describe -t commands 'subcommand' subcommands
         <%-end-%>
  +      _describe -t options 'global options' __<%= program :name %>_common_options
         <%- unless command.nil? then -%>
         _arguments \
           <%- for option in command.options -%>
  
positive.code:             "<%= flatswitches(option).first %><%= takesArg(option) %>[<%= optionDesc option %>]: :" \
            <%- end -%>
          <%- end -%>
        <%- end -%>
      ;;
      (options)
        case $line[1] in
        <%- for sname, cmd in subs -%>
          (<%=sname%>)
          ;;
        <%-end-%>
        esac
  
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' \
  