From bbe32d837581cdcdae4875372675d3341582b8dc Mon Sep 17 00:00:00 2001 From: Daniel Molina Date: Fri, 26 Aug 2011 12:17:26 +0200 Subject: [PATCH] Allow large options in the CLI without defining the short version --- src/cli/command_parser.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/cli/command_parser.rb b/src/cli/command_parser.rb index ef59846023..fb78759722 100755 --- a/src/cli/command_parser.rb +++ b/src/cli/command_parser.rb @@ -301,7 +301,13 @@ EOT merge = @opts merge = @opts + extra_options if extra_options merge.flatten.each do |e| - opts.on(e[:short],e[:large], e[:format],e[:description]) do |o| + args = [] + args << e[:short] if e[:short] + args << e[:large] + args << e[:format] + args << e[:description] + + opts.on(*args) do |o| if e[:proc] e[:proc].call(o, @options) elsif e[:name]=="help"