From d57884965a28c2bfd1ea2e55455e5670b9eec6c6 Mon Sep 17 00:00:00 2001 From: Ronaq13 Date: Thu, 1 Mar 2018 23:22:43 +0530 Subject: [PATCH] Add --plot-to-board to plot command This flag of plot command will send the plotted burndown chart to the first card of the `Done` column. close #134 --- lib/cli.rb | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/lib/cli.rb b/lib/cli.rb index d88a47f..0b11473 100644 --- a/lib/cli.rb +++ b/lib/cli.rb @@ -189,13 +189,24 @@ def burndown end end - desc 'plot SPRINT-NUMBER [--output] [--no-tasks] [--with-fast-lane]', 'Plot burndown chart for given sprint' + desc 'plot SPRINT-NUMBER [--output] [--no-tasks] [--with-fast-lane] [--plot-to-board]', 'Plot burndown chart for given sprint' option :output, aliases: :o, desc: 'Output directory', required: false option 'with-fast-lane', desc: 'Plot Fast Lane with new cards bars', required: false, type: :boolean option 'no-tasks', desc: 'Do not plot tasks line', required: false, type: :boolean + option :plot_to_board, type: :boolean, desc: 'Send the plotted data to the first card of Done column' def plot(sprint_number) process_global_options options - BurndownChart.plot(sprint_number, options) + if options[:plot_to_board] + begin + chart = BurndownChart.new @@settings + chart.update(options) + rescue TrolloloError => e + STDERR.puts e + exit 1 + end + else + BurndownChart.plot(sprint_number, options) + end end desc 'backup', 'Create backup of board'