3
declare(strict_types=1);
6
* This file is part of CodeIgniter 4 framework.
8
* (c) CodeIgniter Foundation <admin@codeigniter.com>
10
* For the full copyright and license information, please view
11
* the LICENSE file that was distributed with this source code.
14
namespace CodeIgniter\Commands;
16
use CodeIgniter\CLI\BaseCommand;
19
* CI Help command for the spark script.
21
* Lists the basic usage information for the spark script,
22
* and provides a way to list help for other commands.
24
class Help extends BaseCommand
27
* The group the command is lumped under
28
* when listing commands.
32
protected $group = 'CodeIgniter';
39
protected $name = 'help';
42
* the Command's short description
46
protected $description = 'Displays basic usage information.';
53
protected $usage = 'help [<command_name>]';
56
* the Command's Arguments
58
* @var array<string, string>
60
protected $arguments = [
61
'command_name' => 'The command name [default: "help"]',
65
* the Command's Options
67
* @var array<string, string>
69
protected $options = [];
72
* Displays the help for spark commands.
74
public function run(array $params)
76
$command = array_shift($params);
78
$commands = $this->commands->getCommands();
80
if (! $this->commands->verifyCommand($command, $commands)) {
84
$class = new $commands[$command]['class']($this->logger, $this->commands);