Skip to content

Commit

Permalink
refactor(input): simplify echoMode
Browse files Browse the repository at this point in the history
Signed-off-by: Carlos Alexandro Becker <[email protected]>
  • Loading branch information
caarlos0 committed Aug 19, 2024
1 parent e095a91 commit 19a93b0
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions input/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package input

import (
"fmt"

"os"

"github.com/charmbracelet/bubbles/key"
Expand Down Expand Up @@ -34,12 +33,9 @@ func (o Options) Run() error {
keymap := huh.NewDefaultKeyMap()
keymap.Quit = key.NewBinding(key.WithKeys("ctrl+c", "esc"))

var echoMode huh.EchoMode

echoMode := huh.EchoModeNormal
if o.Password {
echoMode = huh.EchoModePassword
} else {
echoMode = huh.EchoModeNormal
}

err := huh.NewForm(
Expand All @@ -60,7 +56,6 @@ func (o Options) Run() error {
WithShowHelp(o.ShowHelp).
WithProgramOptions(tea.WithOutput(os.Stderr)).
Run()

if err != nil {
return err
}
Expand Down

0 comments on commit 19a93b0

Please sign in to comment.