16
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
|
# File 'lib/ardb/cli.rb', line 16
def run(*args)
begin
@cli.parse!(args)
Ardb::Runner.new(@cli.args, @cli.opts).run
rescue CLIRB::HelpExit
puts help
rescue CLIRB::VersionExit
puts Ardb::VERSION
rescue Ardb::Runner::UnknownCmdError => err
$stderr.puts "#{err.message}\n\n"
$stderr.puts help
exit(1)
rescue Ardb::NotConfiguredError, Ardb::Runner::CmdError => err
$stderr.puts "#{err.message}"
exit(1)
rescue Ardb::Runner::CmdFail => err
exit(1)
rescue CLIRB::Error => exception
$stderr.puts "#{exception.message}\n\n"
$stderr.puts help
exit(1)
rescue Exception => exception
$stderr.puts "#{exception.class}: #{exception.message}"
$stderr.puts exception.backtrace.join("\n")
exit(1)
end
exit(0)
end
|