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

Default Values in text() Prompts #64

Open
Xevion opened this issue May 19, 2023 · 2 comments
Open

Default Values in text() Prompts #64

Xevion opened this issue May 19, 2023 · 2 comments

Comments

@Xevion
Copy link

Xevion commented May 19, 2023

I'm interested in getting a default value inserted into a text prompt such that the user can hit enter, or 'modify' the default prompt immediately.

For example, given the prompt Enter the uBoot directory, and without entering anything, /boot/uboot could be passed in as the 'default' input for the user. I am not talking about the default output when the user doesn't enter anything themselves - I am talking about the stateful default answer that is filled in.

? Enter the uBoot directory  /boot/uboot

The user could then clear it, edit it, etc.
I am creating "menus" for editing values and it would be more helpful to be able to pass in this so that users could exit without having to re-type the value just so they could keep whatever existed before.

@brodybits
Copy link

This is already supported though pretty badly documented; and I recommend using filepath for this kind of input (could use some better documentation as well).

@Xevion
Copy link
Author

Xevion commented Jan 16, 2024

This is already supported though pretty badly documented; and I recommend using filepath for this kind of input (could use some better documentation as well).

Unfortunately, the filepath being given isn't actually real at the time of configuration. It's not a real filesystem that you can query or navigate. Only later does the path entered become relevant.

brodybits added a commit to brodybits/InquirerLib that referenced this issue Jan 16, 2024
Including some proposed & unpublished updates from InquirerPy:

- kazhala/InquirerPy#69 - fix typos
- kazhala/InquirerPy#65 - add DataValidator class
- kazhala/InquirerPy#56 - add Choice.instruction field
- kazhala/InquirerPy#52 - proper exporting of functions ref:
  - kazhala/InquirerPy#60
  - kazhala/InquirerPy#48

also document some info to address issue: kazhala/InquirerPy#64
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

2 participants