Sha256: 5a3486f9f0d3ed7e6799052d9f91f1b09118651122b3d9550a167920f7c3842d

Contents?: true

Size: 848 Bytes

Versions: 1

Compression:

Stored size: 848 Bytes

Contents

#!/usr/bin/env ruby
# frozen_string_literal: true

require 'bcupgrade'
require 'optparse'
require 'readline'

OptionParser.new do |opt|
  begin
    opt.program_name = File.basename($PROGRAM_NAME)
    opt.banner = "Usage: #{opt.program_name} [options] [cask1 cask2 ...]"

    options = {}
    opt.on('-d', '--dry-run', 'Check version without installing') do |v|
      options[:dry_run] = v
    end
    opt.on('-r', '--remove', 'Remove previous version with installing') do |v|
      options[:remove] = v
    end
    opt.on('-y', '--yes', 'Install cask without prompt') do |v|
      options[:install] = v
    end
    opt.on('-v', '--version', 'Show version number') do
      puts Bcupgrade::VERSION
      exit
    end

    args = opt.parse!(ARGV)

    Bcupgrade.run(options, args)
  rescue => e
    puts "Error: #{e}.\nSee #{opt}"
    exit
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
bcupgrade-0.3.4 exe/bcupgrade