Class: Patcmd::CLI::AddCommand

Inherits:
BaseCommand show all
Defined in:
lib/patcmd/cli/commands/add_command.rb

Constant Summary

Constants inherited from BaseCommand

BaseCommand::CONFIG_PATH

Instance Method Summary collapse

Methods inherited from BaseCommand

#initialize

Methods included from Helpers::Logger

#log_error, #log_info

Methods included from Helpers::TaskHelper

#display_task, #validate_task

Constructor Details

This class inherits a constructor from Patcmd::CLI::BaseCommand

Instance Method Details

#addObject



17
18
19
20
21
22
# File 'lib/patcmd/cli/commands/add_command.rb', line 17

def add
  task = build_task_from_options
  validate_task(task)
  config_manager.add_task(task)
  puts "Added task '#{task["name"]}' under category '#{task["category"]}' with action '#{task["action"]}'."
end