From 3c9be8ea2e0ee3b36254c6a487ab87f196cc5961 Mon Sep 17 00:00:00 2001 From: Akira TAGOH Date: Jan 04 2023 11:21:50 +0000 Subject: Add --tags option to filter issues --- diff --git a/meeting/create-meeting-boilerplate.rb b/meeting/create-meeting-boilerplate.rb index 478628d..7c6efec 100755 --- a/meeting/create-meeting-boilerplate.rb +++ b/meeting/create-meeting-boilerplate.rb @@ -44,7 +44,8 @@ require 'json' date = nil options = { update_bugs: true, output: nil, - oklass: $stdout } + oklass: $stdout, + tags: [] } begin ARGV.options do |opt| @@ -55,6 +56,9 @@ begin options[:output] = v options[:oklass] = File if options[:output] != '-' end + opt.on('-t', '--tags=TAG1,TAG2,...', Array, 'Pick up specific tagged issues only') do |v| + options[:tags] += v + end opt.parse! subargv = opt.order(ARGV) @@ -91,6 +95,9 @@ footer = ['* Open Floor'] header.each do |l| doc += format("%s\n", l) end + +issues.reject! { |i| (options[:tags] & i['tags']).empty? } unless options[:tags].empty? + unless issues.empty? doc += format("* Issue%s\n", issues.length > 1 ? 's' : '') issues.each do |i|