module Employ class CLI < Thor class_option :verbose, type: :boolean, aliases: :v class_option 'assume-yes', type: :boolean, aliases: %w(y yes), desc: 'Automatic yes to prompts' desc 'promote ', 'promotes commit to ' long_desc "TODO" option :interactive, type: :boolean, aliases: :i def promote(env) unless options['assume-yes'] || yes?('Are you sure?') puts 'Nothing done. Bye!' exit 1 end if options[:interactive] last_tag = Git.last_tag(env) puts "last tag: #{last_tag}" if options[:verbose] # TODO else name = Git.tag!(env) puts "New tag promoted: #{name}" if options[:verbose] end end desc 'rollback ', 'rollbacks tag to the penultimate one' long_desc "TODO" def rollback(env) penultimate_tag = Git.penultimate_tag(env) Git.retag! env, penultimate_tag end end end