You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Similar to #41, I'm looking to provide extra information about the choices. Currently I'm using including this info in Choice.name, but this messes with fuzzy.
Perhaps I could change the long instruction on "hover"?
Here's a simplified example:
importdataclassesfromInquirerPyimportinquirerfromInquirerPy.base.controlimportChoice@dataclasses.dataclassclassFruit:
name: strdescription: strfruits= [
Fruit(
"Apple",
"A common, round fruit produced by the tree Malus domestica, cultivated in temperate climates.",
),
Fruit(
"Bananna",
"A banana is an elongated, edible fruit - botanically a berry - produced by several kinds of large herbaceous flowering plants in the genus Musa.",
),
Fruit(
"Peach",
"The peach (Prunus persica) is a deciduous tree first domesticated and cultivated in Zhejiang province of Eastern China.",
),
]
max_name_len=max(len(f.name) forfinfruits)
choices= [Choice(f, f.name.ljust(max_name_len+1) +f.description) forfinfruits]
inquirer.fuzzy("Pick a fruit", choices).execute()
The text was updated successfully, but these errors were encountered:
Gracecr
pushed a commit
to Gracecr/InquirerPy
that referenced
this issue
Feb 13, 2023
Similar to #41, I'm looking to provide extra information about the choices. Currently I'm using including this info in
Choice.name
, but this messes withfuzzy
.Perhaps I could change the long instruction on "hover"?
Here's a simplified example:
The text was updated successfully, but these errors were encountered: