Class: Tlog::Command::Start

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

Instance Attribute Summary

Attributes inherited from Tlog::Command

#date_time_format, #seconds_format, #storage

Instance Method Summary collapse

Instance Method Details

#execute(input, output) ⇒ Object



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

def execute(input, output)
	raise Tlog::Error::CommandInvalid, "Must specify log name" unless input.args[0]
	start(input.args[0], input.options[:description])
end

#nameObject



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

def name 
	"start"
end

#options(parser, options) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/tlog/command/start.rb', line 13

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

   	parser.on("-d", "--description <description>") do |description|
   		options[:description] = description
   	end
end