commander-rb / commander

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

Fix command formatting for commands with long names #9

Closed jszwedko closed 9 years ago

jszwedko commented 9 years ago

By using the longest command and alias names to determine how much to "indent" the descriptions.

Re-opened from https://github.com/tj/commander/issues/98

jszwedko commented 9 years ago

Comment from other PR:

This is a little too much logic in ERB for my taste. I would prefer for this to live in the formatter class.

jszwedko commented 9 years ago

Do you mean, pass the commands into the formatter and have it return the maximum length?

ggilder commented 9 years ago

Sort of... I was thinking the formatter could define methods that would be available in the context where the help template gets rendered. However, now that I've revisited the formatter code I realize that'll be a little messy since it just renders using the binding of the runner. So I think this is good to go as-is. :+1:

Thanks for reopening!

ggilder commented 9 years ago

Ah dang, didn't realize Travis wasn't building PRs. Looks like this introduced a test failure: https://travis-ci.org/commander-rb/commander/jobs/57127299