Class: Tlog::Command::Init

Inherits:
Tlog::Command show all
Defined in:
lib/tlog/command/init.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
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/tlog/command/init.rb', line 8

def execute(input,output)
	if input.args[0].nil?
		raise Tlog::Error::CommandInvalid, "Project already initialized" unless @storage.init_project
	else
		raise Tlog::Error::CommandInvalid, "Command invalid"	
	end
	#elsif input.args[1].nil?
	#	arg1 = input.args.shift
	#	#output.line("arg at 0 was #{arg1}")
	#else
	#	arg1 = input.args.shift
	#	arg2 = input.args.shift
	#	#output.line("arg at 0 was #{arg1}")
	#	#output.line("arg at 1 was #{arg2}")	
	#	raise Tlog::Error::CommandInvalid, "Command invalid"	
	#end

	#@storage.init_project
end

#nameObject



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

def name
	"init"
end

#options(parser, options) ⇒ Object



28
29
30
# File 'lib/tlog/command/init.rb', line 28

def options(parser, options)
	parser.banner = "usage: tlog init" 
end