commander-rb / commander

The complete solution for Ruby command-line executables
MIT License
821 stars 74 forks source link

Fix handling of '--[no-]blah' style flags for global_option #28

Closed mfurtak closed 8 years ago

mfurtak commented 8 years ago

Addresses #27 by ensuring that option switches of the style '--[no-]blah' are expanded into their '--blah' and '--no-blah' possibilities before checking against arguments to remove in remove_global_options

mfurtak commented 8 years ago

The CI failures are from a rubocop style check where my fix has made the Runner class too long. I'm unsure what to do about that!

ggilder commented 8 years ago

For the rubocop check, I would probably just increase or disable the limit in .rubocop_todo.yml, it doesn't seem particularly useful.

I think the patch looks good but could use an additional test to ensure that the correct value of the global option is still presented in the command-level options.

mfurtak commented 8 years ago

@ggilder OK - I've disabled that check and added some more test coverage.

ggilder commented 8 years ago

Looks great! Thanks for the fix.

ggilder commented 8 years ago

This is now released in 4.4.0.

mfurtak commented 8 years ago

Congrats, and thanks! :tada: