lib/gli/app_support.rb in gli-2.11.0 vs lib/gli/app_support.rb in gli-2.12.0
- old
+ new
@@ -26,10 +26,11 @@
@pre_block = false
@post_block = false
@default_command = :help
@around_block = nil
@subcommand_option_handling_strategy = :legacy
+ @argument_handling_strategy = :loose
clear_nexts
end
def exe_name
File.basename($0)
@@ -66,11 +67,12 @@
gli_option_parser = GLIOptionParser.new(commands,
flags,
switches,
accepts,
@default_command,
- self.subcommand_option_handling_strategy)
+ self.subcommand_option_handling_strategy,
+ self.argument_handling_strategy)
parsing_result = gli_option_parser.parse_options(args)
parsing_result.convert_to_openstruct! if @use_openstruct
the_command = parsing_result.command
@@ -197,9 +199,13 @@
def override_default(tokens,config)
tokens.each do |name,token|
token.default_value=config[name] if config[name]
end
+ end
+
+ def argument_handling_strategy
+ @argument_handling_strategy || :loose
end
def subcommand_option_handling_strategy
@subcommand_option_handling_strategy || :legacy
end