public function choose(string $prompt, array $choices)
    {
        echo "$prompt: \n";

        $choicesMap = [];

        $i = 0;
        if (Arrays::isAssoc($choices)) {
            foreach ($choices as $choice => $value) {
                $choicesMap[++$i] = $value;
                echo "\t$i: " . $choice . ' => ' . $value . "\n";
            }
        } else {
            //is sequential
            foreach ($choices as $choice) {
                $choicesMap[++$i] = $choice;
                echo "\t$i: $choice\n";
            }
        }

        if ($this->style) {
            echo $this->formatter->getStartMark($this->style);
        }

        $completionItems = array_keys($choicesMap);
        $choosePrompt = "Please Choose 1-$i > ";

        if (ReadlineConsole::isAvailable()) {
            readline_completion_function(function () use ($completionItems) {
                return $completionItems;
            });
        }

        while (true) {
            $answer = (int) trim($this->console->readLine($choosePrompt));

            if (isset($choicesMap[$answer])) {
                if ($this->style) {
                    echo $this->formatter->getClearMark();
                }

                return $choicesMap[$answer];
            }
        }
    }