diff options
| author | elijah <elijah@riseup.net> | 2014-10-31 16:56:46 -0700 | 
|---|---|---|
| committer | elijah <elijah@riseup.net> | 2014-10-31 16:56:46 -0700 | 
| commit | c05f0def1b5fe4863a80bdfbac3407b011053a89 (patch) | |
| tree | 9f02b206df1b09f67ec231d9cbb3f1d001bf4f20 /bin/leap | |
| parent | a9c79dbb1f8cef409b52835a3d5ee21069434f4c (diff) | |
only spit out stack trace if --debug
Diffstat (limited to 'bin/leap')
| -rwxr-xr-x | bin/leap | 18 | 
1 files changed, 11 insertions, 7 deletions
@@ -1,7 +1,10 @@  #!/usr/bin/env ruby -if ARGV.include?('--debug') +if ARGV.include?('--debug') || ARGV.include?('-d') +  DEBUG=true    require 'debugger' +else +  DEBUG=false  end  begin @@ -89,13 +92,14 @@ module LeapCli::Commands      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 +    if exc.respond_to? :log +      exc.log      else +      puts +      LeapCli.log :error, "%s: %s" % [exc.class, exc.message] +      puts +    end +    if DEBUG        raise exc      end    end  | 
