lib/mercenary/program.rb in mercenary-0.3.6 vs lib/mercenary/program.rb in mercenary-0.4.0

- old
+ new

@@ -1,5 +1,7 @@ +# frozen_string_literal: true + module Mercenary class Program < Command attr_reader :optparse attr_reader :config @@ -29,19 +31,19 @@ begin @optparse.parse!(argv) rescue OptionParser::InvalidOption => e logger.error "Whoops, we can't understand your command." - logger.error "#{e.message}" + logger.error e.message.to_s logger.error "Run your command again with the --help switch to see available options." abort end logger.debug("Parsed config: #{@config.inspect}") begin cmd.execute(argv, @config) - rescue => e + rescue StandardError => e if cmd.trace raise e else logger.error e.message abort