-
Notifications
You must be signed in to change notification settings - Fork 694
Move all usage of survey into an internal pkg #2078
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
Conversation
Another alternative would be to fork github.com/lima-vm/survey
|
pkg/interfaceutil/interfaceutil.go
Outdated
return ans, nil | ||
} | ||
|
||
func Select(message string, options []string) (int, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe "Choose" to avoid confusion with selecting chans or fds
ea12800
to
6fc667a
Compare
This makes it easier to replace the deprecated survey module with another Text User Interface implementation, later on. Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
6fc667a
to
d1f546c
Compare
Is this still a draft? |
I was mostly using it as a base to experiment with bubbletea. Not so impressed with the result...
But we could add it as a refactoring, if the new (minimal) "API" is enough to build on. package uiutil // import "github.com/lima-vm/lima/pkg/uiutil"
func Confirm(message string, defaultParam bool) (bool, error)
func Select(message string, options []string) (int, error) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
This makes it easier to replace the deprecated survey module with another Text User Interface implementation, later on.
User interface library "survey" has been archived #1881
https://github.com/AlecAivazis/survey
None of the currently available alternatives is a good replacement, they take over the entire window and add a lot of deps.
https://github.com/charmbracelet/bubbletea
https://github.com/rivo/tview