def run
      request_config if @options[:reauth]
      if @options[:changelog]
        system %[ more "#{File.join(File.dirname(__FILE__), '../../CHANGELOG.markdown')}" ]
        exit
      end
      begin
        if @command
          if command? @command
            result = send @command, *@args
            if not result.nil?
              if result.respond_to? :join, include_all=false
                puts result.join(', ')
              elsif result.respond_to? :to_s, include_all=false
                puts result
              end
            end
          else
            puts start(@command, *@args)
          end
        else
          puts show
        end
      rescue CommandError => e
        $stderr.puts e
        exit 1
      rescue RuntimeError => e
        $stderr.puts "Error: #{e}"
        exit 1
      rescue Faraday::Error => e
        $stderr.puts "Connection failed. (#{e.message})"
        exit 1
      rescue HarvestMiddleware::ThrottleFailure => e
        $stderr.puts "Too many requests, retrying in #{e.retry_after+5} seconds..."
        sleep e.retry_after+5
        run
      rescue HarvestMiddleware::AuthFailure => e
        $stderr.puts "Unable to authenticate: #{e}"
        request_config
        run
      rescue HarvestMiddleware::Failure => e
        $stderr.puts "API failure: #{e}"
        exit 1
      end
    end
def run
      request_config if @options[:reauth]
      if @options[:changelog]
        system %[ more "#{File.join(File.dirname(__FILE__), '../../CHANGELOG.markdown')}" ]
        exit
      end
      begin
        if @command
          if command? @command
            result = send @command, *@args
            if not result.nil?
              if result.respond_to? :join, include_all=false
                puts result.join(', ')
              elsif result.respond_to? :to_s, include_all=false
                puts result
              end
            end
          else
            puts start(@command, *@args)
          end
        else
          puts show
        end
      rescue CommandError => e
        $stderr.puts e
        exit 1
      rescue RuntimeError => e
        $stderr.puts "Error: #{e}"
        exit 1
      rescue Faraday::Error => e
        $stderr.puts "Connection failed. (#{e.message})"
        exit 1
      rescue HarvestMiddleware::ThrottleFailure => e
        $stderr.puts "Too many requests, retrying in #{e.retry_after+5} seconds..."
        sleep e.retry_after+5
        run
      rescue HarvestMiddleware::AuthFailure => e
        $stderr.puts "Unable to authenticate: #{e}"
        request_config
        run
      rescue HarvestMiddleware::Failure => e
        $stderr.puts "API failure: #{e}"
        exit 1
      end
    end
Start the application.