added help:commands task to artisan

This commit is contained in:
Shawn McCool
2012-07-12 00:30:04 +02:00
parent 1503aed7ce
commit 29b668b83d
3 changed files with 125 additions and 0 deletions

View 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);
}
}
}
}