52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
|
# File 'lib/twat.rb', line 52
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 InvalidSetOpt
puts "There is no such configurable option"
opts.usage
rescue RequiresOptVal
puts "--set must take an option=value pair as arguments"
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"
rescue InvalidBool
puts "Invalid value, valid values are #{Options::BOOL_VALID.join("|")}"
rescue InvalidInt
puts "Invalid value, must be an integer"
rescue Errno::ECONNRESET
puts "Connection was reset by third party."
rescue TweetTooLong
puts "Twitter enforces a maximum status length of 140 characters"
end
end
|