def run
      @running = true

      while running?
        # Get next item
        e = @unprocessed_arguments_and_options.shift
        break if e.nil?

        if e == '--'
          handle_dashdash(e)
        elsif e =~ /^--./ && !@no_more_options
          handle_dashdash_option(e)
        elsif e =~ /^-./ && !@no_more_options
          handle_dash_option(e)
        else
          add_argument(e)
        end
      end

      add_defaults

      self
    ensure
      @running = false
    end
def run
      @running = true

      while running?
        # Get next item
        e = @unprocessed_arguments_and_options.shift
        break if e.nil?

        if e == '--'
          handle_dashdash(e)
        elsif e =~ /^--./ && !@no_more_options
          handle_dashdash_option(e)
        elsif e =~ /^-./ && !@no_more_options
          handle_dash_option(e)
        else
          add_argument(e)
        end
      end

      add_defaults

      self
    ensure
      @running = false
    end
Parses the command-line arguments into options and arguments.

 During parsing, two errors can be raised:

 @raise IllegalOptionError if an unrecognised option was encountered,
   i.e. an option that is not present in the list of option definitions

 @raise OptionRequiresAnArgumentError if an option was found that did not
   have a value, even though this value was required.

 @return [Cri::Parser] The option parser self