checkSetup has verbose disabled if not explicitly called

This commit is contained in:
tracer 2022-09-17 17:39:47 +02:00
parent e94819ed7f
commit 61b24edfdf
1 changed files with 12 additions and 3 deletions

View File

@ -54,7 +54,7 @@ class CLIController
function checkSetup(): void
{
if (!$this->domainController->checkPermissions()) {
if (!$this->domainController->checkPermissions(disableVerbose: true)) {
echo 'You need to setup the bindAPI first.' . PHP_EOL;
exit(1);
}
@ -102,7 +102,7 @@ class CLIController
'domains' => $this->handleDomains(subcommand: $subcommand),
'dyndns' => $this->handleDynDns(subcommand: $subcommand),
'nameservers' => $this->handleNameservers(subcommand: $subcommand),
default => $this->unknownSubcommand(subcommand: $subcommand)
default => $this->unknownCommand(command: $command)
};
}
@ -180,6 +180,12 @@ class CLIController
}
function unknownCommand(string $command): void
{
echo COLOR_DEFAULT . 'Unknown command: ' . COLOR_YELLOW . $command . COLOR_DEFAULT . PHP_EOL;
}
function unknownSubcommand(string $subcommand): void
{
if ($subcommand) {
@ -1029,6 +1035,7 @@ class CLIController
exit(1);
}
// TODO remove
echo 'fqdn: ' . $name;
$domainParts = explode(separator: '.', string: $name);
@ -1052,7 +1059,9 @@ class CLIController
}
echo "found domian" . $foundDomain . PHP_EOL;
if ($this->configController->getConfig(configKey: 'verbose')) {
echo "Found domain: " . $foundDomain . PHP_EOL;
}
// get host