Class: Patcmd::Commands::List

Inherits:
Base
  • Object
show all
Defined in:
lib/patcmd/commands/list.rb

Instance Method Summary collapse

Instance Method Details

#executeObject



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/patcmd/commands/list.rb', line 11

def execute(*)
  tasks = Configuration.load_tasks
  if tasks.empty?
    say("No tasks found. Use 'patcmd add <name>' to add tasks.", :yellow)
  else
    tasks.each do |name, task_data|
      task = Task.new(name, task_data)
      say("#{name} - #{task.description}", :blue)
    end
  end
end