bin/deploy_log in deploy_log-0.1.8 vs bin/deploy_log in deploy_log-0.1.9a

- old
+ new

@@ -1,11 +1,11 @@ #! /usr/bin/env ruby # frozen_string_literal: true require 'deploy_log' -start, finish, title, branch, on = nil +start, finish, title, branch, on, week = nil OptionParser.new do |opt| opt.on('-s', '--start=START', 'Start of date range') do |time| start = Time.parse(time) end @@ -24,16 +24,22 @@ opt.on('-b', '--branch=BRANCH', 'Name of the branch you want') do |br| branch = br end + opt.on('-w', '--week=WEEK', 'Get PRs merged during week number X') do |w| + week = w + end + opt.on('-v', '--version', 'Prints version information') do puts DeployLog::VERSION exit end end.parse! model = DeployLog::Github::Deploys.new + +return model.merged_during_week(week) if week return model.merged_between(start, finish) if start return model.merged_on(on) if on return model.pr_title(title) if title return model.pr_for_branch(branch) if branch return model.merged_today if title.nil? && branch.nil? && start.nil? && finish.nil? && on.nil?