From b083a9e458c293f2be577461da95567994cd7487 Mon Sep 17 00:00:00 2001 From: Daniel Molina Date: Tue, 12 Jul 2011 16:13:34 +0200 Subject: [PATCH] feature #647: If the column does not exists using the -l option show an error --- src/cli/cli_helper.rb | 3 +-- src/cli/command_parser.rb | 8 +------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/cli/cli_helper.rb b/src/cli/cli_helper.rb index daa359c665..92cc0b5045 100644 --- a/src/cli/cli_helper.rb +++ b/src/cli/cli_helper.rb @@ -192,8 +192,7 @@ module CLIHelper size=@columns[field][:size] return "%#{minus}#{size}.#{size}s" % [ data.to_s ] else - puts "Column not defined" - exit -1 + exit -1, "Column not defined" end end diff --git a/src/cli/command_parser.rb b/src/cli/command_parser.rb index 6190027c2d..166566c3ac 100755 --- a/src/cli/command_parser.rb +++ b/src/cli/command_parser.rb @@ -169,13 +169,7 @@ EOT if comm check_args!(comm_name, comm[:arity], comm[:args_format]) - begin - rc = comm[:proc].call - rescue Exception =>e - puts e.message - exit -1 - end - + rc = comm[:proc].call if rc.instance_of?(Array) puts rc[1] exit rc.first