Class: Toga::Commands::Current

Inherits:
List show all
Defined in:
lib/toga/commands/current.rb

Class Method Summary collapse

Methods included from Error

included

Class Method Details

.run!(*args) ⇒ Object


7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/toga/commands/current.rb', line 7

def self.run!(*args)
  if !args.first || args.first.count == 0
    return super [:current]
  end

  # Make a task current.
  prefix = args.join(' ')
  full = Togafile.remove_from_group :later, prefix
  if !full
    return error "Wasn't found."
  end
  Togafile.append_to_group :current, full
  puts "Moved '#{full}' to current tasks."
end