lib/task_manager/cli.rb in task_manager2-0.0.14 vs lib/task_manager/cli.rb in task_manager2-0.0.15
- old
+ new
@@ -26,12 +26,17 @@
desc 'current', 'Current task'
def current
TaskManager.current
end
- desc 'finish', 'Finish the current task'
+ desc 'finish', 'Finish the current task or finish the task with ID in the waiting queue'
+ method_option :id, aliases: '-i', desc: 'ID of the task', type: :numeric
def finish
- TaskManager.finish
+ if options[:id]
+ TaskManager.finish_with_id(options[:id])
+ else
+ TaskManager.finish
+ end
end
desc 'stats', 'Statistics of all queues'
def stats
TaskManager.stats