diff --git a/src/Controller/CLIController.php b/src/Controller/CLIController.php index 50eacbd..06a00f9 100644 --- a/src/Controller/CLIController.php +++ b/src/Controller/CLIController.php @@ -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