#!/usr/bin/env ruby require "circleci/bundle/update/pr" require 'optparse' opt = OptionParser.new options = { assignees: [] } opt.on('-a', '--assignees alice,bob,carol', Array, 'Assign the PR to them') { |v| options[:assignees] = v.map(&:strip) } opt.on('-r', '--reviewers alice,bob,carol', Array, 'Request PR review to them') { |v| options[:reviewers] = v.map(&:strip) } opt.on('-l', '--labels "In Review, Update"', Array, 'Add labels to the PR') { |v| options[:labels] = v.map(&:strip) } opt.parse!(ARGV) Circleci::Bundle::Update::Pr.create_if_needed( git_username: ARGV.shift, git_email: ARGV.shift, git_branches: ARGV.empty? ? ["master"] : ARGV, assignees: options[:assignees], reviewers: options[:reviewers], labels: options[:labels], )