added help:commands task to artisan
This commit is contained in:
35
laravel/cli/tasks/help.php
Normal file
35
laravel/cli/tasks/help.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php namespace Laravel\CLI\Tasks;
|
||||
|
||||
use Laravel\Str;
|
||||
use Laravel\File;
|
||||
|
||||
class Help extends Task {
|
||||
|
||||
/**
|
||||
* List
|
||||
*
|
||||
* @param array $arguments
|
||||
* @return void
|
||||
*/
|
||||
public function commands()
|
||||
{
|
||||
|
||||
$command_data = json_decode(file_get_contents(__DIR__.'/help.json'));
|
||||
|
||||
$i=0;
|
||||
|
||||
foreach($command_data as $category => $commands)
|
||||
{
|
||||
|
||||
if($i++ != 0) echo PHP_EOL;
|
||||
|
||||
echo PHP_EOL . "# $category" . PHP_EOL;
|
||||
|
||||
foreach($commands as $command => $details)
|
||||
{
|
||||
echo PHP_EOL . str_pad($command, 20) . str_pad($details->description, 30);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user