def option_parser
      @option_parser ||= OptionParser.new do |opts|
        opts.banner = 'Usage: stove [OPTIONS]'

        opts.separator ''
        opts.separator 'Plugins:'

        opts.on('--no-git', 'Do not use the git plugin. Skips tagging if specified.') do
          options[:no_git] = true
        end

        opts.separator ''
        opts.separator 'Upload Options:'

        opts.on('--endpoint [URL]', 'Supermarket endpoint') do |v|
          options[:endpoint] = v
        end

        opts.on('--username [USERNAME]', 'Username to authenticate with') do |v|
          options[:username] = v
        end

        opts.on('--key [PATH]', 'Path to the private key on disk') do |v|
          options[:key] = v
        end

        opts.on('--[no-]extended-metadata', 'Include non-backwards compatible metadata keys such as `issues_url`') do |v|
          options[:extended_metadata] = v
        end

        opts.on('--no-ssl-verify', 'Turn off ssl verify') do
          options[:ssl_verify] = false
        end

        opts.separator ''
        opts.separator 'Git Options:'

        opts.on('--remote [REMOTE]', 'Name of the git remote') do |v|
          options[:remote] = v
        end

        opts.on('--branch [BRANCH]', 'Name of the git branch') do |v|
          options[:branch] = v
        end

        opts.on('--sign', 'Sign git tags') do
          options[:sign] = true
        end

        opts.separator ''
        opts.separator 'Artifactory Options:'

        opts.on('--artifactory [URL]', 'URL for the Artifactory repository') do |v|
          options[:artifactory] = v
        end

        opts.on('--artifactory-key [KEY]', 'Artifactory API key to use') do |v|
          options[:artifactory_key] = if v[0] == '@'
            # If passed a key looking like @foo, read it as a file. This allows
            # passing in the key securely.
            IO.read(File.expand_path(v[1..-1]))
          else
            v
          end
        end

        opts.separator ''
        opts.separator 'Global Options:'

        opts.on('--log-level [LEVEL]', 'Set the log verbosity') do |v|
          options[:log_level] = v
        end

        opts.on('--path [PATH]', 'Change the path to a cookbook') do |v|
          options[:path] = v
        end

        opts.on_tail('-h', '--help', 'Show this message') do
          puts opts
          exit
        end

        opts.on_tail('-v', '--version', 'Show version') do
          puts Stove::VERSION
          exit(0)
        end
      end
    end
def option_parser
      @option_parser ||= OptionParser.new do |opts|
        opts.banner = 'Usage: stove [OPTIONS]'

        opts.separator ''
        opts.separator 'Plugins:'

        opts.on('--no-git', 'Do not use the git plugin. Skips tagging if specified.') do
          options[:no_git] = true
        end

        opts.separator ''
        opts.separator 'Upload Options:'

        opts.on('--endpoint [URL]', 'Supermarket endpoint') do |v|
          options[:endpoint] = v
        end

        opts.on('--username [USERNAME]', 'Username to authenticate with') do |v|
          options[:username] = v
        end

        opts.on('--key [PATH]', 'Path to the private key on disk') do |v|
          options[:key] = v
        end

        opts.on('--[no-]extended-metadata', 'Include non-backwards compatible metadata keys such as `issues_url`') do |v|
          options[:extended_metadata] = v
        end

        opts.on('--no-ssl-verify', 'Turn off ssl verify') do
          options[:ssl_verify] = false
        end

        opts.separator ''
        opts.separator 'Git Options:'

        opts.on('--remote [REMOTE]', 'Name of the git remote') do |v|
          options[:remote] = v
        end

        opts.on('--branch [BRANCH]', 'Name of the git branch') do |v|
          options[:branch] = v
        end

        opts.on('--sign', 'Sign git tags') do
          options[:sign] = true
        end

        opts.separator ''
        opts.separator 'Artifactory Options:'

        opts.on('--artifactory [URL]', 'URL for the Artifactory repository') do |v|
          options[:artifactory] = v
        end

        opts.on('--artifactory-key [KEY]', 'Artifactory API key to use') do |v|
          options[:artifactory_key] = if v[0] == '@'
            # If passed a key looking like @foo, read it as a file. This allows
            # passing in the key securely.
            IO.read(File.expand_path(v[1..-1]))
          else
            v
          end
        end

        opts.separator ''
        opts.separator 'Global Options:'

        opts.on('--log-level [LEVEL]', 'Set the log verbosity') do |v|
          options[:log_level] = v
        end

        opts.on('--path [PATH]', 'Change the path to a cookbook') do |v|
          options[:path] = v
        end

        opts.on_tail('-h', '--help', 'Show this message') do
          puts opts
          exit
        end

        opts.on_tail('-v', '--version', 'Show version') do
          puts Stove::VERSION
          exit(0)
        end
      end
    end
The option parser for handling command line flags.

 @return [OptionParser]