Closed igneus closed 1 year ago
If the change of Thor::Command
constructor argument count were undesired, an alternative proposal would be to preserve the original argument count, but change the type of long_description
from String
to String|Hash
, where the Hash form would allow passing presentation settings alongside text in a single argument. Like
Thor::Command.new('name', 'Description', {text: 'Long description ...', wrap: false}, nil, nil)
This would be 100% backward-compatible and would allow eventually adding more long_desc
presentation settings in future.
What it does
The PR implements this suggestion from the #398 comments.
long_desc
now receives a new optionwrap
. Setting it tofalse
disables wrapping of the long description and prints it verbatim.What it breaks
It adds a new obligatory constructor argument to
Thor::Command
. If the constructor is considered part of the public API, this may be a problem.(I did read CONTRIBUTING.md, but I prefer not to use the rainbow emoji because of the meanings it usually carries nowadays, hence the cloud in PR title.)