Skip to content

Commit

Permalink
Merge pull request #145 from akhoury6/align_output
Browse files Browse the repository at this point in the history
Align the short and long forms into their own columns in the help output
  • Loading branch information
Fryguy committed Apr 26, 2024
2 parents 30b3b84 + 5284dd0 commit 936e463
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/optimist.rb
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions test/optimist/parser_test.rb
Expand Up @@ -471,8 +471,8 @@ def test_multi_line_description
@p.educate(out)
assert_equal <<-EOM, out.string
Options:
--arg=<i> This is an arg
with a multi-line description
--arg=<i> This is an arg
with a multi-line description
EOM
end

Expand Down

0 comments on commit 936e463

Please sign in to comment.