Skip to content
This repository has been archived by the owner on Apr 19, 2024. It is now read-only.

V2

Compare
Choose a tag to compare
@AlecAivazis AlecAivazis released this 13 Jun 23:12
· 80 commits to master since this release
1c1eed8

This is the first major update in survey's history! 🎉

In the past, we've taken a lot of care to make sure that surveys 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 and MultiSelect will write the selected index when copying to a field that's an int
  • AskOne no longer takes a Validator as the third argument
    • pass the survey.WithValidator option instead
  • settable is now Settable
  • survey.PageSize has been removed.
    • pass the survey.WithPageSize option instead
  • 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 and MultiSelect.FilterFn to *.Filter
    • you can pass survey.WithFilter to set the default filter for your prompts
  • Fixed behavior of selects when filtering out all of the options
  • Removed surveyCore.HelpInputRune in favor of survey.WithHelpInput
  • Icons are now configure with the survey.WithIcons option