'Laravel Command - break param description into two lines
I use Laravel 5.8. In one of my artisan command files I have a parameter with quiet long description, which I would like to break into 2 lines:
class GenerateReport extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'report:generate
{--myparam : long description to be broken into several lines}';
I tried \n and <br>, but both are printed out as text.
For example, if I add \n after the word description the output of php artisan report:generate -h is:
Description:
Command description...
Usage:
report:generate [options]
Options:
--myparam long description\nto be broken into several lines
-h, --help Display this help message
-q, --quiet Do not output any message
-V, --version Display this application version
--ansi Force ANSI output
--no-ansi Disable ANSI output
-n, --no-interaction Do not ask any interactive question
--env[=ENV] The environment the command should run under
-v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
I also dived into vendor code, but could not figure out how to do it (in some place I could not continue following the code).
I found this article, but it seems this is not applied on the $signature printing.
Any idea?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
