Non puoi selezionare più di 25 argomenti
Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
28 righe
1.2 KiB
28 righe
1.2 KiB
<?php |
|
|
|
use Studioamica\ChangelogsWriter\Core\ChangelogCommands; |
|
|
|
include __DIR__ . "/config.php"; |
|
|
|
$changelogs_commands = new ChangelogCommands(); |
|
$changelogs_commands->loadConfiguration(__DIR__ . "/config.php"); |
|
|
|
if (method_exists($changelogs_commands, $argv[1] ?? null)) { |
|
$changelogs_commands->{$argv[1]}(array_slice($argv, 2)); |
|
} else { |
|
$ref_class = new ReflectionClass("Studioamica\ChangelogsWriter\Core\ChangelogCommands"); |
|
$docs = ""; |
|
foreach ($ref_class->getMethods() as $method) { |
|
if ($method != "__construct") { |
|
$comment = $ref_class->getMethod($method->name)->getDocComment(); |
|
if (strpos($comment, "Command example:\n") !== false) { |
|
$comment = str_replace("Command example", "\033[36m{$method->name}\033[0m", $comment); |
|
$comment = str_replace("/**\n", "", $comment); |
|
$comment = str_replace(" */", " -----", $comment); |
|
$comment = str_replace(" *", "", $comment); |
|
$comment = str_replace("changelog.php /path/to/config.php ", "changelog ",$comment); |
|
echo $comment . "\n"; |
|
} |
|
} |
|
} |
|
} |