# File lib/rhc/command_runner.rb, line 51
    def run!
      trace = false
      require_program :version, :description

      global_option('-h', '--help', 'Help on any command', :hide => true)
      global_option('--version', 'Display version information', :hide => true)

      # special case --debug so all commands can output relevant info on it
      $terminal.debug = options_parse_debug

      # special case --trace because we need to use it in the runner
      trace = options_parse_trace

      # special case --version so it is processed before an invalid command
      options_parse_version

      # help is a special branch prior to command execution
      options_parse_help

      unless trace
        begin
          run_active_command
        rescue InvalidCommandError => e
          run_help(provided_arguments)
        rescue \
          OptionParser::InvalidOption => e
          RHC::Helpers.error e.message
          1
        rescue \
          ArgumentError,
          OptionParser::ParseError => e

          help_bindings = CommandHelpBindings.new(active_command, commands, self)
          usage = RHC::HelpFormatter.new(self).render_command_syntax(help_bindings)
          message = case e
          when OptionParser::AmbiguousOption
            "The option #{e.args.join(' ')} is ambiguous. You will need to specify the entire option."
          else
            e.message
          end

          RHC::Helpers.error message
          say "#{usage}"
          1
        rescue RHC::Exception, RHC::Rest::Exception => e
          RHC::Helpers.error e.message
          e.code.nil? ? 128 : [1, (e.code || 1).to_i].max
        end
      else
        run_active_command
      end
    end