-
Notifications
You must be signed in to change notification settings - Fork 19
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
Add extra information to Choice #56
base: master
Are you sure you want to change the base?
Conversation
Allows the developer to specify additional information to appear next to their choices. kazhala#55
@kazhala hate to be a bother, but would you mind giving this PR a look when you get a chance? |
@Gracecr this is a nice add. i.e. if e.g. removing from InquirerPy import inquirer
from InquirerPy.base.control import Choice
region = inquirer.select(
message="Select regions:",
choices=[
Choice("ap-southeast-2", name="Sydney", instruction="Region in Australia"),
Choice("ap-southeast-1", name="Singapore", instruction="Region in Southeast Asia"),
],
).execute() Might be worth looking into? |
Strange, I'm not getting the same error. I'm able to run your example code (minus the instruction's) without error: from InquirerPy import inquirer
from InquirerPy.base.control import Choice
region = inquirer.select(
message="Select regions:",
choices=[
Choice("ap-southeast-2", name="Sydney"),
Choice("ap-southeast-1", name="Singapore"),
],
).execute() I just tested with py3.7 and py3.10 on windows in CMD. If you don't mind posting your stack trace, perhaps that will help me resolve the issue. |
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
@kazhala any chance you could take a look into this? I find it really helpful |
This adds
Choice.instruction
.Supports all prompts that use
Choice
.I've only added support for Alternative Syntax, but am open to adding support for Classic syntax if you'd like.
Closes #55.