document negative option for boolean option #390

Merged
merged 1 commit into from Mar 22, 2014

Conversation

Projects
None yet
4 participants
Contributor

developingchris commented Dec 24, 2013

Added test and implementation for options that are boolean to document a
--no-option that is equivalent to passing false.

This is to address issue #377

@developingchris developingchris document negative option for boolean option
Added test and implementation for options that are boolean to document a
--no-option that is equivalent to passing false.
2c4f421

Coverage Status

Coverage increased (+0.01%) when pulling 2c4f421 on developingchris:boolean_negative into 62593e0 on erikhuda:master.

@rafaelfranca rafaelfranca commented on the diff Dec 31, 2013

lib/thor/parser/option.rb
@@ -85,6 +85,10 @@ def usage(padding = 0)
sample = "[#{sample}]" unless required?
+ if boolean?
+ sample << ", [#{dasherize("no-" + human_name)}]" unless name == "force"
@rafaelfranca

rafaelfranca Dec 31, 2013

Contributor

skip is also a valid prefix. I think we should document it too

Owner

sferik commented Mar 22, 2014

Thanks!

sferik merged commit 34a85b7 into erikhuda:master Mar 22, 2014

1 check passed

default The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment