Skip to content

Commit 9619f3e

Browse files
committed
Update Command.php
1 parent 6bb36a2 commit 9619f3e

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/Ubiquity/devtools/cmd/Command.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -580,6 +580,22 @@ public static function preloadCustomCommands(array $config = []) {
580580
}
581581
}
582582

583+
public static function getCommandNames(array $excludedCategories = [
584+
'installation' => false,
585+
'servers' => false
586+
], $excludedCommands = []) {
587+
$result = [];
588+
$commands = self::getCommands();
589+
foreach ($commands as $command) {
590+
$cat = $command->getCategory();
591+
$commandName = $command->getName();
592+
if (! isset($excludedCommands[$commandName]) && ! isset($excludedCategories[$cat])) {
593+
$result[] = $commandName;
594+
}
595+
}
596+
return $result;
597+
}
598+
583599
public static function getCommands() {
584600
return [
585601
self::initCache(),

0 commit comments

Comments
 (0)