bin/gitscape in gitscape-1.4.1 vs bin/gitscape in gitscape-1.5

- old
+ new

@@ -28,36 +28,49 @@ options = {} op = OptionParser.new do |op| op.banner = 'Usage: gitscape [action] [options]' op.separator('Options:') - op.on '--trace', 'Verbose output for debugging' do - options[:trace] = true + + op.on '--[no-]trace', 'Verbose output for debugging' do |bool| + options[:trace] = bool end + op.on '-h', '--help', 'Show a list of actions' do puts OVERVIEW exit end -end -args = op.parse(ARGV) + op.on '-p', '--[no-]push', 'Whether or not to push changes to origin' do |bool| + options[:push] = bool + end + + op.on '-u', '--[no-]update-env', 'Whether to update environment branches when their development branch is updated' do |bool| + options[:update_env] = bool + end -# Get the app name. Note that if the app name is 'app', we have to rename it -# so that it doesn't conflict with the 'app' subdirectory. + op.on '-e', '--env-depth=ENV', [:staging, :qa, :live], 'The level of environments to push changes to' do |depth| + options[:env_depth] = depth + end +end +op.parse!(ARGV) + if ARGV.size < 1 - puts op - exit(1) + puts OVERVIEW + exit else - case ARGV[0] + command_name = ARGV[0] + case command_name when "hotfix_start" - Gitscape::Base.new.hotfix_start ARGV[1] + hotfix_branch = ARGV[1] + Gitscape::Base.new.hotfix_start hotfix_branch, options when "hotfix_finish" - Gitscape::Base.new.hotfix_finish ARGV[1] + Gitscape::Base.new.hotfix_finish hotfix_branch, options when "release_start" - Gitscape::Base.new.release_start + Gitscape::Base.new.release_start options when "release_finish" - Gitscape::Base.new.release_finish ARGV[1].to_i + Gitscape::Base.new.release_finish options else - puts "Unknown command" + puts "Unknown command: #{command_name}" end end