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
Hi team, it's me again! I promise I will stop creating these after I finish the migration from Survey.
Is your feature request related to a problem? Please describe.
Survey inputs had an option to add an input "suggestion", user could press the [Tab] key and they would get the list of suggestions. This could be useful, if programme asks the user to input the existing filename (at least this is my use case).
I know that you already know what I'm writing about, but for completeness, here's the link.
Describe the solution you'd like
I would like to be able to specify the function that would make an input suggestion to the user.
When there's one and only one suggestion, the tab should complete the input to the suggested value.
When there's more than one suggestion there are two possible options: first one is to show the list of all, or "top N" items that match the prefix entered, or, cycle through suggestions on each press of the [Tab] key, just like cmd.exe prompt does in Windows.
Please keep in mind that I just started using Huh, so maybe there's some bubble-magic that I'm unaware of that allows to implement this easily?
Describe alternatives you've considered
The alternative that I have considered is not using the suggestions, or implement it myself, which I haven't gotten around to, as I'm quite new to the whole charm.sh framework.
Additional context
Here's how it's implemented in Survey (copy/pasting here for convenience):
file:=""prompt:=&survey.Input{
Message: "inform a file to save:",
Suggest: func (toCompletestring) []string {
files, _:=filepath.Glob(toComplete+"*")
returnfiles
},
}
}
survey.AskOne(prompt, &file)
Thank you for consideration.
The text was updated successfully, but these errors were encountered:
Hi team, it's me again! I promise I will stop creating these after I finish the migration from Survey.
Is your feature request related to a problem? Please describe.
Survey inputs had an option to add an input "suggestion", user could press the [Tab] key and they would get the list of suggestions. This could be useful, if programme asks the user to input the existing filename (at least this is my use case).
I know that you already know what I'm writing about, but for completeness, here's the link.
Describe the solution you'd like
I would like to be able to specify the function that would make an input suggestion to the user.
When there's one and only one suggestion, the tab should complete the input to the suggested value.
When there's more than one suggestion there are two possible options: first one is to show the list of all, or "top N" items that match the prefix entered, or, cycle through suggestions on each press of the [Tab] key, just like
cmd.exe
prompt does in Windows.Please keep in mind that I just started using Huh, so maybe there's some bubble-magic that I'm unaware of that allows to implement this easily?
Describe alternatives you've considered
The alternative that I have considered is not using the suggestions, or implement it myself, which I haven't gotten around to, as I'm quite new to the whole charm.sh framework.
Additional context
Here's how it's implemented in Survey (copy/pasting here for convenience):
Thank you for consideration.
The text was updated successfully, but these errors were encountered: