diff --git a/lib/optimist.rb b/lib/optimist.rb index 9aa8962..73ef909 100644 --- a/lib/optimist.rb +++ b/lib/optimist.rb @@ -636,7 +636,7 @@ def parse(_paramlist, _neg_given) def type_format ; "" ; end def educate - (short? ? "-#{short}, " : "") + "--#{long}" + type_format + (flag? && default ? ", --no-#{long}" : "") + (short? ? "-#{short}, " : " ") + "--#{long}" + type_format + (flag? && default ? ", --no-#{long}" : "") end ## Format the educate-line description including the default-value(s) diff --git a/test/optimist/parser_test.rb b/test/optimist/parser_test.rb index fbb3b4a..8fd4fce 100644 --- a/test/optimist/parser_test.rb +++ b/test/optimist/parser_test.rb @@ -471,8 +471,8 @@ def test_multi_line_description @p.educate(out) assert_equal <<-EOM, out.string Options: - --arg= This is an arg - with a multi-line description + --arg= This is an arg + with a multi-line description EOM end