You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
desc 'Compute a matrix and save to the desktop'
arg_name 'matrix'
command :compute do |c|
c.desc 'format'
c.default_value 'csv'
c.flag :f, :format
c.desc 'path to file'
c.default_value File.join(conf.compute_output_dir, "#{Time.now.strftime("%y%m%d%H%M%S")}")
c.flag :p, :path
c.action(&method(:compute))
end
In 2.5.6, inside the called method compute, the options hash would contain pairs of entries for both :f and :format and :p and :path that pointed to the default values. In 2.6, the long form of the option is not being included in the Hash-- it has only :f and :p keys. If I switch the order of the symbols in the flag list, then it is only :format and :path that show up-- so it looks like only the first name for the flag is recorded. This is happening either with or without the subcommand_option_handling :normal directive introduced in 2.6.
The text was updated successfully, but these errors were encountered:
Yeah, this is subtle. Since I moved to OptionParser, I just had the block of on set the value in the hashes for all aliases in symbol and string form. The defaults aren't set that way. Looking into it…
I have a command declared like this:
In 2.5.6, inside the called method
compute
, the options hash would contain pairs of entries for both :f and :format and :p and :path that pointed to the default values. In 2.6, the long form of the option is not being included in the Hash-- it has only:f
and:p
keys. If I switch the order of the symbols in the flag list, then it is only:format
and:path
that show up-- so it looks like only the first name for the flag is recorded. This is happening either with or without thesubcommand_option_handling :normal
directive introduced in 2.6.The text was updated successfully, but these errors were encountered: