Hi all,
I was after some advice, I’m running CakePHP 4.1.6 and have created a command setting the required to true, but I’m finding I can no longer call the command with --help because it complains about the missing required options.
Do I need to set something to still allow the help command even though I have some required options?
public function buildOptionParser(ConsoleOptionParser $parser): ConsoleOptionParser
{
$parser = parent::buildOptionParser($parser);
$parser->addOptions([
'action' => [
'help' => __d('console', 'Action to perform'),
'required' => true,
'choices' => ['UPDATE', 'RESOLVE'],
],
'id' => [
'help' => __d('console', 'Internal Case ID'),
'required' => true,
],
'number' => [
'help' => __d('console', 'External Case Number'),
'required' => true,
],
]);
return $parser;
}
Gives me:
commandname --help
Error: Missing required option. The action
option is required and has no default value.
Thanks in advance