# File lib/Getopt/Declare.rb, line 526
    def initialize(spec, desc, dittoflag)
      first = 1


      @@nextid += 1
      @flag     = ''
      @foundid  = nil
      @args     = []
      @actions  = []
      @ditto    = dittoflag
      @required = 0
      @requires = nil
      @id       = @@nextid
      @desc     = spec.dup
      @items    = 0
      @nocase   = false

      @desc.sub!(/\A\s*(.*?)\s*\Z/,'\1')

      while spec && spec != ''
        begin

          # OPTIONAL

          if spec.sub!( /\A(\s*)\[/, '\1' )
            @args.push( StartOpt.new )
            next
          elsif spec.sub!(/\A\s*\]/,"")
            @args.push( EndOpt.new )
            next
          end

          # ARG


          se  = DelimScanner::new( spec )
          tmp = se.scanBracketed('<>')

          arg = nows = nil
          arg, spec, nows = tmp[:match], tmp[:suffix], tmp[:prefix] if tmp


          if arg
            arg =~ /\A(\s*)(<)([a-zA-Z]\w*)(:[^>]+|)>/ or
              raise "Error: bad Getopt::Declare parameter variable specification near '#{arg}'\n"

            # NAME,TYPE,NOW

            details = [ "#$3", "#$4", !first && !(nows.length>0) ]

            if spec && spec.sub!( /\A\.\.\./, "")      # ARRAY ARG

              @args.push( ArrayArg.new(*details) )
            else  # SCALAR ARG

              @args.push( ScalarArg.new(*details) )
            end
            @items += 1
            next

            # PUNCTUATION

          elsif spec.sub!( /\A(\s*)((\\.|[^\] \t\n\[<])+)/, '' )
            ows, punct = $1, $2
            punct.gsub!( /\\(?!\\)(.)/, '\1' )

            if first
              spec  =~ /\A(\S+)/
              @foundid = "#{punct}#{$1}"
              @flag = punct
              @@flags.push( punct )
            else
              @args.push( Punctuator.new(punct, !(ows.size > 0)) )
              @items += 1
            end

          else 
            break
          end # if arg/spec.sub

        ensure
          first = nil
        end
      end # while



      @@helpcmdH.delete(@flag)    if @@helpcmdH.key?(@flag)
      @@versioncmdH.delete(@flag) if @@versioncmdH.key?(@flag)
    end