Class: Tlog::Command::Checkout

Inherits:
Tlog::Command show all
Defined in:
lib/tlog/command/checkout.rb

Instance Attribute Summary

Attributes inherited from Tlog::Command

#date_time_format, #seconds_format, #storage

Instance Method Summary collapse

Instance Method Details

#descriptionObject



8
9
10
# File 'lib/tlog/command/checkout.rb', line 8

def description 
  "checkouts a time log in order to start tasks on"
end

#execute(input, output) ⇒ Object



12
13
14
15
16
# File 'lib/tlog/command/checkout.rb', line 12

def execute(input, output)
  raise Tlog::Error::CommandInvalid, "Must specify log name" unless input.args[0]
  checkout(input.args[0])
  output.line("Checked-out log '#{input.args[0]}'");
end

#nameObject



4
5
6
# File 'lib/tlog/command/checkout.rb', line 4

def name
  "checkout"
end

#options(parser, options) ⇒ Object



18
19
20
# File 'lib/tlog/command/checkout.rb', line 18

def options(parser, options)
  parser.banner = "usage: tlog checkout <log_name>"
end