rails / thor

Thor is a toolkit for building powerful command-line interfaces.
http://whatisthor.com/
MIT License
5.12k stars 553 forks source link

Allow leading hyphen in switch values when specified with = #737

Closed univerio closed 3 years ago

univerio commented 4 years ago

This is a fixed version of #498.

This allows --foo=-bar to work.

The implementation works by keeping track of an additional piece of state @force_current_to_be_value, which is maintained inside shift and unshift to ensure it matches the state in @pile.