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
Here is an example to replicate the bug, as well as examples of running it, including the output and expected output. Repeatable options don't seem to work with the hash type.
#!/usr/bin/env ruby# frozen_string_literal: truerequire"thor"classExampleCLI < Thordesc"example","shows how broken things are"option:doesnt,:required=>false,:default=>{},:repeatable=>true,:type=>:hash,:desc=>"Should be repeatable but isn't"option:works,:repeatable=>true,:required=>false,:type=>:stringdefcreate()putsoptionsenddefself.exit_on_failure?trueendendExampleCLI.start(ARGV)
You hand in two hashes and expect them to be set as two hashes in an array. What do you get? one hash, not in an array, with all key/vals merged into one hash.
They treated like every other type now. Instead of merging each key/val
into a hash, each flag is treated like it's own hash that should be put
into an array.
fixesrails#768
Here is an example to replicate the bug, as well as examples of running it, including the output and expected output. Repeatable options don't seem to work with the hash type.
You hand in two hashes and expect them to be set as two hashes in an array. What do you get? one hash, not in an array, with all key/vals merged into one hash.
Instead, you should end up with an array of two different hashes:
Ordering doesn't seem to matter. It's still broken.
if your keys in your objects are the same, youll end up with one object whos key values are the last ones you handed in.
Instead, you should end up with an array of two different hashes:
The text was updated successfully, but these errors were encountered: