def optparse(*args)
      opts = OptionParser.new

      opts.banner = 'usage: pullr URI [PATH]'

      opts.on('-S','--scm NAME','Source Code Management to use') do |scm|
        @scm = scm
      end

      opts.on('-U','--uri URI','The URI of the repository') do |uri|
        @uri = uri
      end

      opts.on('-u','--update [PATH]','Update the repository') do |path|
        @mode = :update
        @path = (path || Dir.pwd)
      end

      begin
        @args = opts.parse!(args)
      rescue OptionParser::InvalidOption => e
        $stderr.puts e.message
        $stderr.puts opts
        exit -1
      end
    end
def optparse(*args)
      opts = OptionParser.new

      opts.banner = 'usage: pullr URI [PATH]'

      opts.on('-S','--scm NAME','Source Code Management to use') do |scm|
        @scm = scm
      end

      opts.on('-U','--uri URI','The URI of the repository') do |uri|
        @uri = uri
      end

      opts.on('-u','--update [PATH]','Update the repository') do |path|
        @mode = :update
        @path = (path || Dir.pwd)
      end

      begin
        @args = opts.parse!(args)
      rescue OptionParser::InvalidOption => e
        $stderr.puts e.message
        $stderr.puts opts
        exit -1
      end
    end
Parses the given arguments.

 @param [Array<String>] args
   The command-line arguments.