def run(args) #:nodoc:
      args = args.dup if @preserve_argv
      the_command = nil
      begin
        override_defaults_based_on_config(parse_config)

        add_help_switch_if_needed(self)

        gli_option_parser = GLIOptionParser.new(commands,
                                                flags,
                                                switches,
                                                accepts,
                                                :default_command => @default_command,
                                                :autocomplete => autocomplete,
                                                :subcommand_option_handling_strategy => subcommand_option_handling_strategy,
                                                :argument_handling_strategy => argument_handling_strategy)

        parsing_result = gli_option_parser.parse_options(args)
        parsing_result.convert_to_openstruct! if @use_openstruct

        the_command = parsing_result.command

        if proceed?(parsing_result)
          call_command(parsing_result) 
          0
        else
          raise PreconditionFailed, "preconditions failed"
        end
      rescue Exception => ex
        if the_command.nil? && ex.respond_to?(:command_in_context)
          the_command = ex.command_in_context
        end
        handle_exception(ex,the_command)
      end
    end
def run(args) #:nodoc:
      args = args.dup if @preserve_argv
      the_command = nil
      begin
        override_defaults_based_on_config(parse_config)

        add_help_switch_if_needed(self)

        gli_option_parser = GLIOptionParser.new(commands,
                                                flags,
                                                switches,
                                                accepts,
                                                :default_command => @default_command,
                                                :autocomplete => autocomplete,
                                                :subcommand_option_handling_strategy => subcommand_option_handling_strategy,
                                                :argument_handling_strategy => argument_handling_strategy)

        parsing_result = gli_option_parser.parse_options(args)
        parsing_result.convert_to_openstruct! if @use_openstruct

        the_command = parsing_result.command

        if proceed?(parsing_result)
          call_command(parsing_result) 
          0
        else
          raise PreconditionFailed, "preconditions failed"
        end
      rescue Exception => ex
        if the_command.nil? && ex.respond_to?(:command_in_context)
          the_command = ex.command_in_context
        end
        handle_exception(ex,the_command)
      end
    end
Runs whatever command is needed based on the arguments.

 +args+:: the command line ARGV array

 Returns a number that would be a reasonable exit code