46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
# File 'lib/twat.rb', line 46
def cli_run
begin
opts = ArgParse.new
actor = Actions.new
actor.config = config
actor.opts = opts
actor.send(opts.options[:action])
rescue Usage
opts.usage
rescue NoSuchAccount
puts "No such account"
opts.usage
rescue NoDefaultAccount
puts "No default account configured."
rescue NoSuchCommand
puts "No such command"
opts.usage
rescue NoConfigFile
puts "No config file, create one with twat -a [user|nick]"
opts.usage
rescue InvalidCredentials
puts "Invalid credentials, try reauthenticating with"
puts "twat -a #{opts[:account]}"
rescue ConfigVersionIncorrect
puts "Your config file is out of date. Run with --update-config to rememdy"
end
end
|