Skip to content

Commit

Permalink
interactive uninstall help #181
Browse files Browse the repository at this point in the history
Signed-off-by: Denis Vaumoron <dvaumoron@gmail.com>
  • Loading branch information
dvaumoron committed Jul 14, 2024
1 parent b4586b9 commit 4735401
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions cmd/tenv/textui.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"io"
"slices"

"github.com/charmbracelet/bubbles/key"
"github.com/charmbracelet/bubbles/list"
tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/lipgloss"
Expand Down Expand Up @@ -158,6 +159,31 @@ func uninstallUI(versionManager versionmanager.VersionManager) error {
l.Styles.PaginationStyle = paginationStyle
l.Styles.HelpStyle = helpStyle

l.AdditionalFullHelpKeys = func() []key.Binding {
return []key.Binding{
key.NewBinding(
key.WithKeys("space"),
key.WithHelp("space", "select item"),
),
key.NewBinding(
key.WithKeys("enter"),
key.WithHelp("enter", "validate uninstallation"),
),
}
}
l.AdditionalShortHelpKeys = func() []key.Binding {
return []key.Binding{
key.NewBinding(
key.WithKeys("space"),
key.WithHelp("space", "select"),
),
key.NewBinding(
key.WithKeys("enter"),
key.WithHelp("enter", "validate"),
),
}
}

m := itemModel{
choices: selection,
list: l,
Expand Down

0 comments on commit 4735401

Please sign in to comment.