From ccf0506585514e6119dba0ecb5264ad447a5f064 Mon Sep 17 00:00:00 2001 From: myrmidex Date: Sat, 22 Aug 2026 22:42:58 +0200 Subject: [PATCH] never mind minLength if --top enabled + delete obsolete files --- src/ArgHandler.php | 34 ------------------------ src/Commands/FindAnagramWordsCommand.php | 6 +++-- src/Output.php | 12 --------- 3 files changed, 4 insertions(+), 48 deletions(-) delete mode 100644 src/ArgHandler.php delete mode 100644 src/Output.php diff --git a/src/ArgHandler.php b/src/ArgHandler.php deleted file mode 100644 index 9050067..0000000 --- a/src/ArgHandler.php +++ /dev/null @@ -1,34 +0,0 @@ -args = new Collection($argv); - } - - public static function make(array $argv): self - { - return new self($argv); - } - - public function get(int $index) - { - return $this->args - ->reject(fn($word) => substr($word, 0, 2) === '--') - ->get($index); - } - - public function hasOption(string $option) - { - return $this->args - ->filter(fn($word) => $word === '--' . $option) - ->isNotEmpty(); - } -} diff --git a/src/Commands/FindAnagramWordsCommand.php b/src/Commands/FindAnagramWordsCommand.php index 5bd2201..ad9d952 100644 --- a/src/Commands/FindAnagramWordsCommand.php +++ b/src/Commands/FindAnagramWordsCommand.php @@ -30,13 +30,15 @@ class FindAnagramWordsCommand extends Command info("ANAGRAM FINDER"); $anagram = $anagram ??= text("Enter the anagram", required: true); - $minLength = $minLength ?: text(label: "Enter the minimum length of the results. (default=3)", placeholder: 3, default: 3, required: true); + $minLength = $top === true + ? 3 + : ($minLength ?: text(label: "Enter the minimum length of the results. (default=3)", placeholder: 3, default: 3, required: true)); info("Results for your anagram: " . $anagram); $matches = spin( callback: fn() => Matcher::findWords($anagram, $minLength), - message: 'Checking wordlist...', + message: 'Checking dictionary...', ); if ($top) { diff --git a/src/Output.php b/src/Output.php deleted file mode 100644 index 5d1b3cb..0000000 --- a/src/Output.php +++ /dev/null @@ -1,12 +0,0 @@ -