lib/gli/app_support.rb in gli-2.0.0 vs lib/gli/app_support.rb in gli-2.1.0
- old
+ new
@@ -35,16 +35,17 @@
# Get the default command for the entire app
def get_default_command
@default_command
end
- # Runs whatever command is needed based on the arguments.
+ # Runs whatever command is needed based on the arguments.
#
# +args+:: the command line ARGV array
#
# Returns a number that would be a reasonable exit code
def run(args) #:nodoc:
+ args = args.dup if @preserve_argv
command = nil
begin
override_defaults_based_on_config(parse_config)
add_help_switch_if_needed(switches)
@@ -167,10 +168,10 @@
def handle_exception(ex,command)
if regular_error_handling?(ex)
stderr.puts error_message(ex)
if ex.kind_of?(OptionParser::ParseError) || ex.kind_of?(BadCommandLine)
stderr.puts
- commands[:help] and commands[:help].execute([],[],command.nil? ? [] : [command.name.to_s])
+ commands[:help] and commands[:help].execute({},{},command.nil? ? [] : [command.name.to_s])
end
end
raise ex if ENV['GLI_DEBUG'] == 'true'