You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
--help resolves the wrong command and bypasses a registered help command #36
Console::run() handles -h/--help by instantiating the built in Help command directly and letting it read argument 0 as the command name (src/Console.php:289-292, src/Commands/Help.php:28-35). Three problems follow.
1. --help fails on any command that takes arguments. Argument 0 is used as the command name even when it is a value:
2. A registered custom help command is ignored.new Help($this) skips the command registry, so $console->addCommand(new MyHelp($console)) is honoured by php app help deploy but not by php app deploy --help.
3. -h is globally reserved. A command that documents -h for its own use can never receive it:
protected array $options = ['-h, --host' => 'The host to bind.'];
// php app serve -h 0.0.0.0 -> Command not found: "0.0.0.0"
Suggested fix: resolve help through getCommand('help') so overrides work, and only treat argument 0 as a target when it actually names a registered command, otherwise fall back to the current command name. Point 3 needs a decision: either let a command opt out of the global -h, or reserve only the long --help.
Activity