17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
# File 'lib/ronin/cli.rb', line 17
def run(argv)
command = argv.shift
if command.nil? || %w[-h --help].include?(command)
puts help
exit 0
end
case command
when '-v', '--version'
puts "ronin #{Ronin::VERSION}"
exit 0
when 'focus'
handle_focus(argv)
when 'rest'
handle_rest(argv)
when 'status'
handle_status
when 'log'
handle_log(argv)
when 'streak'
handle_streak
else
warn "Unknown command: '#{command}'"
puts help
exit 1
end
rescue StandardError => e
warn "Error: #{e.message}"
exit 1
end
|