9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
# File 'lib/tlog/application.rb', line 9
def run
command_name = ""
outcome = false
begin
command_name = @input.args.shift
command = find(command_name)
prepare_command(command)
outcome = run_command(command)
rescue OptionParser::InvalidOption, OptionParser::MissingArgument
@output.error($!)
@output.error(@optparse.to_s)
rescue Tlog::Error::CommandInvalid
@output.error(command_name + " command invalid: " + $!.message)
@output.error(@optparse.to_s)
rescue Tlog::Error::CommandNotFound, OptionParser::MissingArgument
@output.error($!)
@output.error(@optparse.to_s)
rescue
@output.error($!)
end
return outcome
end
|