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'