From 09a82209f3a40e75caf966ba41b17da1a9ced146 Mon Sep 17 00:00:00 2001 From: elijah Date: Fri, 27 Jun 2014 17:19:51 -0700 Subject: leap list improvements: lazy evaluation; don't bomb on ConfigError; remove requirements.rb --- bin/leap | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'bin') diff --git a/bin/leap b/bin/leap index 75c14c7..c492127 100755 --- a/bin/leap +++ b/bin/leap @@ -78,9 +78,26 @@ module LeapCli::Commands exit(0) end + # disable GLI error catching + ENV['GLI_DEBUG'] = "true" + def error_message(msg) + end + # load commands and run commands_from('leap_cli/commands') ORIGINAL_ARGV = ARGV.dup - exit_status = run(ARGV) - exit(LeapCli::Util.exit_status || exit_status) + begin + exit_status = run(ARGV) + exit(LeapCli::Util.exit_status || exit_status) + rescue StandardError => exc + if LeapCli.log_level < 2 + if exc.respond_to? :log + exc.log + else + puts "%s: %s" % [exc.class, exc.message] + end + else + raise exc + end + end end -- cgit v1.2.3