12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
# File 'lib/toggl_cmd/runner.rb', line 12
def self.toggl(args)
token = IO.readlines(File.expand_path("~/.toggl")).join.strip
options = RunnerOptions.new(args)
if options[:time_entries]
prettify_tasks(Toggl.new(token, NAME).time_entries)
elsif options[:projects]
prettify_projects(Toggl.new(token, NAME).projects)
elsif options[:delete]
toggl = Toggl.new(token, NAME)
toggl.delete_time_entry(options[:delete])
prettify_tasks(toggl.time_entries)
elsif options.any?
prettify_tasks(Toggl.new(token, NAME, options.delete(:debug)).create_time_entry(options))
else
puts options.opts
end
end
|