I have a Java CLI application (no frameworks, plain Java), in which I am getting input from the client via Scanner. I'm letting the client choose between several options (by index), and returning the resulting string. But I'd like the client to be able to edit the string before further processing. Is there a technique to request user input, but to pre-populate it with a suggestion? I'm looking for something akin to a HTML field with a value attribute. Here's a sketch of the interaction:
Please choose from the list below
1 - Option 1 bla bla bla
2 - Option 2 which is entirely different
0 - None (abort)
# We read user input from scanner.nextInt()
# Assuming the user chose 1, we convert the text of Option 1 to 'option-1-bla-bla-bla'
# But we would like to give the user the option to edit that value:
Edit the value we will use:
$ option-1-bla-bla-bla # How can I present the user with the option to edit this?