diff --git a/lib/thor/parser/option.rb b/lib/thor/parser/option.rb index 8d4e9d444..4eb15928d 100644 --- a/lib/thor/parser/option.rb +++ b/lib/thor/parser/option.rb @@ -85,10 +85,6 @@ def usage(padding = 0) sample = "[#{sample}]" unless required? - if boolean? - sample << ", [#{dasherize("no-" + human_name)}]" unless name == "force" or name.start_with?("no-") - end - if aliases.empty? (" " * padding) << sample else diff --git a/spec/parser/option_spec.rb b/spec/parser/option_spec.rb index ff81a767a..5cc56691a 100644 --- a/spec/parser/option_spec.rb +++ b/spec/parser/option_spec.rb @@ -178,23 +178,7 @@ def option(name, options = {}) end it "returns usage for boolean types" do - expect(parse(:foo, :boolean).usage).to eq("[--foo], [--no-foo]") - end - - it "does not use padding when no aliases are given" do - expect(parse(:foo, :boolean).usage).to eq("[--foo], [--no-foo]") - end - - it "documents a negative option when boolean" do - expect(parse(:foo, :boolean).usage).to include("[--no-foo]") - end - - it "does not document a negative option for a negative boolean" do - expect(parse(:'no-foo', :boolean).usage).not_to include("[--no-no-foo]") - end - - it "documents a negative option for a positive boolean starting with 'no'" do - expect(parse(:'nougat', :boolean).usage).to include("[--no-nougat]") + expect(parse(:foo, :boolean).usage).to eq("[--foo]") end it "uses banner when supplied" do @@ -215,10 +199,6 @@ def option(name, options = {}) it "does not show the usage between brackets" do expect(parse([:foo, "-f", "-b"], :required).usage).to eq("-f, -b, --foo=FOO") end - - it "does not negate the aliases" do - expect(parse([:foo, "-f", "-b"], :boolean).usage).to eq("-f, -b, [--foo], [--no-foo]") - end end end end