Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Text Input: No blanks, validation fails, default not possible #20

Open
Fmstrat opened this issue Apr 7, 2020 · 1 comment
Open

Text Input: No blanks, validation fails, default not possible #20

Fmstrat opened this issue Apr 7, 2020 · 1 comment

Comments

@Fmstrat
Copy link

Fmstrat commented Apr 7, 2020

Perhaps this is user error with the new version, but there is no example that demonstrates how to use anything but the default when default is set.

For instance, from https://github.com/kahkhang/Inquirer.sh/blob/master/examples/text_input_example.sh, there is:

text_input "Gender" gender "Male"

However, if you use this, it doesn't show a default, instead it fails validation unless your answer is the default. So basically, you MUST type "Male" to get out of the prompt.

I also don't see any details on how to use the validation. I'd like to do something like this:

text_input "What IP range should the server use?" IP_RANGE "192.168.99.1/24" "Invalid IP range format." ???????

But even if this was working, I'm not sure what to include here. The name of a previously defined function?

Thanks!

@Fmstrat
Copy link
Author

Fmstrat commented Apr 7, 2020

As a note, I would expect to see something like this, where I could press enter to select the default:

printf "${green}?${normal} What IP range should the server use [${dim}192.168.99.1/24${normal}]?"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant