This repository has been archived by the owner on Apr 19, 2024. It is now read-only.
V2
This is the first major update in survey's history! 🎉
In the past, we've taken a lot of care to make sure that survey
s API is as stable as possible. With this release, that streak is broken and I hope you trust that the decision didn't come lightly.
In general, this release can be summarized as an attempt to remove all global configuration and move as much as we could into AskOpts
. For a detailed explanation of how the API works now, please see the README. Here is a quick summary of the changes:
- New import path (
github.com/AlecAivazis/survey/v2
) Select
andMultiSelect
will write the selected index when copying to a field that's anint
AskOne
no longer takes aValidator
as the third argument- pass the
survey.WithValidator
option instead
- pass the
settable
is nowSettable
survey.PageSize
has been removed.- pass the
survey.WithPageSize
option instead
- pass the
- Changed the prompt interface to accept a new
PromptConfig
struct where we can add configuration for new features without breaking the API again - Changed signature of
Filter
to be focused on a single element and added the ability to filter by its index - Renamed
Select.FilterFn
andMultiSelect.FilterFn
to*.Filter
- you can pass
survey.WithFilter
to set the default filter for your prompts
- you can pass
- Fixed behavior of selects when filtering out all of the options
- Removed
surveyCore.HelpInputRune
in favor ofsurvey.WithHelpInput
- Icons are now configure with the
survey.WithIcons
option