private String readUserInput(PromptOptions options) {
        PrintWriter writer = new PrintWriter(System.out);
        writer.print(options.inputMessage);
        if (options.defaultValue != null)
            writer.println(" Default is " + options.defaultValue);
        else
            writer.println();

        if (options.choices != null && !options.choices.isEmpty()) {
            for (int i = 0; i < options.choices.size(); i++) {
                if (options.choiceAsNumber) {
                    writer.print((i + 1) + ".");
                }
                writer.println(options.choices.get(i));
            }
        }
        writer.print("> ");
        writer.flush();
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        String line = null;
        try {
            line = reader.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return line != null ? line.trim() : line;
    }