# File lib/rhc/commands.rb, line 26
      def run!
        trace = false
        require_program :version, :description
        trap('INT') { abort program(:int_message) } if program(:int_message)
        trap('INT') { program(:int_block).call } if program(:int_block)
        global_option('-h', '--help', 'Display help documentation') do
          args = @args - %w[-h --help]
          command(:help).run(*args)
          return
        end
        global_option('-v', '--version', 'Display version information') { say version; return }
        global_option('-t', '--trace', 'Display backtrace when an error occurs') { trace = true }
        parse_global_options
        remove_global_options options, @args

        # if help is last arg run as if --help was passed in
        if @args[-1] == "help"
          args = @args - ["help"]
          command(:help).run(*args)
          return
        end

        unless trace
          begin
            run_active_command
          rescue InvalidCommandError => e
            usage = RHC::UsageHelpFormatter.new(self).render
            i = @args.find_index { |a| a.start_with?('-') } || @args.length
            abort "The command 'rhc #{@args[0,i].join(' ')}' is not recognized.\n#{usage}"
          rescue \
            ArgumentError,
            OptionParser::InvalidOption,
            OptionParser::InvalidArgument,
            OptionParser::MissingArgument => e

            help_bindings = CommandHelpBindings.new(active_command, commands, Commander::Runner.instance.options)
            usage = RHC::UsageHelpFormatter.new(self).render_command(help_bindings)
            say "#{e}\n#{usage}"
            1
          rescue RHC::Rest::Exception, RHC::Exception => e
            RHC::Helpers.results { say e.message }
            e.code.nil? ? 128 : e.code
          rescue => e
            RHC::Helpers.results { say "error: #{e} Use --trace to view backtrace." }
            128
          end
        else
          run_active_command
        end
      end