bin/status in update_status-0.2.2 vs bin/status in update_status-0.3.0

- old
+ new

@@ -4,13 +4,20 @@ $:.unshift File.join(File.dirname(__FILE__), *%w[.. lib]) require 'status' require 'optparse' +options ={ + :qa_status => :pending, + :branch => nil, + :sha => nil +} + OptionParser.new do |o| - o.on("-s STATE", "--state", "Status of QA (default pending) [pending/pass]") {|s| $state = s } - o.on("-b BRANCH", "--branch BRANCH", "Branch name") {|b| $branch = b } + o.on("-q STATE", "--qa STATE", "Status of QA (default pending) [pending/pass/'n/a']") {|s| options[:state] = s } + o.on("-b BRANCH", "--branch BRANCH", "Branch name") {|b| options[:branch] = b } o.on("-h", "--help", "Display this screen") {puts o; exit } + o.on("-s SHA", "--sha SHA") {|sha| options[:sha]=sha || nil} o.parse! end -Status::Base.new({:state => $state, :branch => $branch}).update +Status::Base.new(options).update \ No newline at end of file