Skip to content

Commit

Permalink
[application] Hide system commands from help
Browse files Browse the repository at this point in the history
  • Loading branch information
yannoff committed Feb 10, 2023
1 parent 236bad8 commit 9e921ea
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,11 @@ public function getUsage($tab = Formatter::TAB, $width = Formatter::PAD)
$lines[] = "<strong>Commands</strong>";

foreach ($this->commands as $name => $command) {
// Don't display help or version commands
if (in_array($name, [self::COMMAND_HELP, self::COMMAND_VERS])) {
continue;
}

$lines[] = sprintf("${tab}%-{$width}s %s", $name, $command->getHelp());
}

Expand Down

0 comments on commit 9e921ea

Please sign in to comment.