Short description of the issue
In commit 8056c484, ProcessWireCli::executeCommand() renders the help screen when no args are given, then continues and calls $mod->executeCli([]) anyway. CLI modules whose executeCli doesn't gracefully handle an empty args array emit confusing output (or fail) after the help text.
Expected behavior
php index.php some-command (no args) prints the help screen and returns without invoking the command's CLI handler.
Actual behavior
wire/core/Tools/ProcessWireCli.php:97-116:
if(empty($args)) {
echo $this->renderHelp($name);
}
try { $mod->executeCli($args); ... }
There's no return / continue after renderHelp(). The result is help text immediately followed by whatever the module's executeCli([]) produces — often an error or another help dump.
Optional: Suggestion for a possible fix
if(empty($args)) {
echo $this->renderHelp($name);
return;
}
Setup/Environment
- ProcessWire version:
dev @ 15c749ed
- File:
wire/core/Tools/ProcessWireCli.php:97-116
- Introduced in commit 8056c484
Short description of the issue
In commit 8056c484,
ProcessWireCli::executeCommand()renders the help screen when no args are given, then continues and calls$mod->executeCli([])anyway. CLI modules whoseexecuteClidoesn't gracefully handle an empty args array emit confusing output (or fail) after the help text.Expected behavior
php index.php some-command(no args) prints the help screen and returns without invoking the command's CLI handler.Actual behavior
wire/core/Tools/ProcessWireCli.php:97-116:There's no
return/continueafterrenderHelp(). The result is help text immediately followed by whatever the module'sexecuteCli([])produces — often an error or another help dump.Optional: Suggestion for a possible fix
Setup/Environment
dev@15c749edwire/core/Tools/ProcessWireCli.php:97-116