diff --git a/.gitignore b/.gitignore index e5982599..52e91155 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ *__debug_bin1675735721 .DS_Store .env +components/mdz/bin/mdz .idea *.iml components/ledger/_docker-compose.yml diff --git a/components/mdz/bin/mdz b/components/mdz/bin/mdz index 9d2b7108..8faa563d 100755 Binary files a/components/mdz/bin/mdz and b/components/mdz/bin/mdz differ diff --git a/components/mdz/internal/rest/auth.go b/components/mdz/internal/rest/auth.go index 41f1b2c0..76951372 100644 --- a/components/mdz/internal/rest/auth.go +++ b/components/mdz/internal/rest/auth.go @@ -37,7 +37,7 @@ func (r *Auth) AuthenticateWithCredentials(username, password string) (*model.To } if resp.StatusCode != http.StatusOK { - return nil, fmt.Errorf("error: status %d - %w", resp.StatusCode, err) + return nil, fmt.Errorf("status %d", resp.StatusCode) } var tokenResponse model.TokenResponse diff --git a/components/mdz/pkg/cmd/login/login.go b/components/mdz/pkg/cmd/login/login.go index 07a79bf9..f5c5762b 100644 --- a/components/mdz/pkg/cmd/login/login.go +++ b/components/mdz/pkg/cmd/login/login.go @@ -25,10 +25,24 @@ type factoryLogin struct { auth repository.Auth } +func validateCredentials(username, password string) error { + if len(username) == 0 { + return errors.New("username must not be empty") + } + + if len(password) == 0 { + return errors.New("password must not be empty") + } + + return nil +} + func (l *factoryLogin) runE(cmd *cobra.Command, _ []string) error { - if cmd.Flags().Changed("username") && - cmd.Flags().Changed("password") && - len(l.username) > 0 && len(l.password) > 0 { + if cmd.Flags().Changed("username") && cmd.Flags().Changed("password") { + if err := validateCredentials(l.username, l.password); err != nil { + return err + } + r := rest.Auth{Factory: l.factory} _, err := r.AuthenticateWithCredentials(l.username, l.password) @@ -37,6 +51,8 @@ func (l *factoryLogin) runE(cmd *cobra.Command, _ []string) error { } output.Printf(l.factory.IOStreams.Out, color.New(color.Bold).Sprint("Successfully logged in")) + + return nil } option, err := tui.Select( @@ -84,6 +100,10 @@ func (l *factoryLogin) execMethodLogin(answer string) error { case strings.Contains(answer, "terminal"): err := l.terminalLogin() + if err := validateCredentials(l.username, l.password); err != nil { + return err + } + if err != nil { return err } diff --git a/components/mdz/pkg/cmd/login/term.go b/components/mdz/pkg/cmd/login/term.go index 255d7111..cfcf4513 100644 --- a/components/mdz/pkg/cmd/login/term.go +++ b/components/mdz/pkg/cmd/login/term.go @@ -16,7 +16,7 @@ func (l *factoryLogin) terminalLogin() error { } if len(l.password) == 0 { - l.password, err = tui.Password() + l.password, err = tui.Password("Enter your password") if err != nil { return err } diff --git a/components/mdz/pkg/tui/constant.go b/components/mdz/pkg/tui/constant.go deleted file mode 100644 index 520d2e9e..00000000 --- a/components/mdz/pkg/tui/constant.go +++ /dev/null @@ -1,9 +0,0 @@ -package tui - -const ( - ctrlC = "ctrl + c" - enter = "enter" - backspace = "backspace" - left = "left" - right = "right" -) diff --git a/components/mdz/pkg/tui/input.go b/components/mdz/pkg/tui/input.go index 5c4c27c3..5a15d7a2 100644 --- a/components/mdz/pkg/tui/input.go +++ b/components/mdz/pkg/tui/input.go @@ -3,6 +3,7 @@ package tui import ( "fmt" + "github.com/charmbracelet/bubbles/textinput" tea "github.com/charmbracelet/bubbletea" ) @@ -12,80 +13,58 @@ func Input(message string) (string, error) { func runInput(m tea.Model) (string, error) { p := tea.NewProgram(m) - finalModel, err := p.Run() + finalModel, err := p.Run() if err != nil { - return "", fmt.Errorf("erro ao iniciar o programa: %w", err) + return "", fmt.Errorf("error starting program: %w", err) } - if pm, ok := finalModel.(inputModel); ok && pm.entered { - return pm.input, nil + if im, ok := finalModel.(inputModel); ok && im.inputDone { + return im.textInput.Value(), nil } return "", nil } -func initialInputModel(message string) inputModel { - return inputModel{message: message} +type inputModel struct { + textInput textinput.Model + message string + inputDone bool } -type inputModel struct { - message string - input string - cursor int - entered bool +func initialInputModel(message string) inputModel { + ti := textinput.New() + ti.Placeholder = "..." + ti.Focus() + ti.CharLimit = 156 + ti.Width = 20 + + return inputModel{textInput: ti, message: message} } func (m inputModel) Init() tea.Cmd { - return nil + return textinput.Blink } func (m inputModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) { + var cmd tea.Cmd + switch msg := msg.(type) { case tea.KeyMsg: - switch msg.String() { - case ctrlC: + switch msg.Type { + case tea.KeyCtrlC, tea.KeyEsc: return m, tea.Quit - case enter: - m.entered = true + case tea.KeyEnter: + m.inputDone = true return m, tea.Quit - case backspace: - if m.cursor > 0 { - m.input = m.input[:m.cursor-1] + m.input[m.cursor:] - m.cursor-- - } - case left: - if m.cursor > 0 { - m.cursor-- - } - case right: - if m.cursor < len(m.input) { - m.cursor++ - } - default: - // Adiciona o caractere digitado à entrada - m.input = m.input[:m.cursor] + msg.String() + m.input[m.cursor:] - m.cursor++ } } - return m, nil + m.textInput, cmd = m.textInput.Update(msg) + + return m, cmd } func (m inputModel) View() string { - if m.entered { - return "Entry received!\n" - } - - return fmt.Sprintf("%s: %s\n", m.message, m.input) + return fmt.Sprintf("%s %s\n", m.message, m.textInput.View()) } - -// Example of using -// func main() { -// input, err := Input("Enter your name") -// if err != nil { -// fmt.Fprintf(os.Stderr, "Error: %v\n", err) -// os.Exit(1) -// } - -// fmt.Printf("Name entered: %s\n", input) diff --git a/components/mdz/pkg/tui/password.go b/components/mdz/pkg/tui/password.go index 3411cc74..0cc861b1 100644 --- a/components/mdz/pkg/tui/password.go +++ b/components/mdz/pkg/tui/password.go @@ -2,96 +2,71 @@ package tui import ( "fmt" - "strings" + "github.com/charmbracelet/bubbles/textinput" tea "github.com/charmbracelet/bubbletea" ) -func Password() (string, error) { - return runPassword(initialPasswordModel()) +func Password(message string) (string, error) { + return runPasswordInput(initialPasswordInputModel(message)) } -func runPassword(m tea.Model) (string, error) { +func runPasswordInput(m tea.Model) (string, error) { p := tea.NewProgram(m) finalModel, err := p.Run() if err != nil { - return "", fmt.Errorf("error starting the program: %w", err) + return "", fmt.Errorf("error starting program: %w", err) } - if pm, ok := finalModel.(passwordModel); ok && pm.entered { - return pm.password, nil + if im, ok := finalModel.(passwordModel); ok && im.inputDone { + return im.textInput.Value(), nil } return "", nil } -func initialPasswordModel() passwordModel { - return passwordModel{} +type passwordModel struct { + textInput textinput.Model + message string + inputDone bool } -type passwordModel struct { - password string - cursor int - entered bool +func initialPasswordInputModel(message string) passwordModel { + ti := textinput.New() + ti.Placeholder = "..." + ti.Focus() + ti.EchoMode = textinput.EchoPassword + ti.EchoCharacter = '*' + ti.CharLimit = 50 + ti.Width = 20 + + return passwordModel{textInput: ti, message: message} } func (m passwordModel) Init() tea.Cmd { - return nil + return textinput.Blink } func (m passwordModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) { + var cmd tea.Cmd + switch msg := msg.(type) { case tea.KeyMsg: - switch msg.String() { - case ctrlC: + switch msg.Type { + case tea.KeyCtrlC, tea.KeyEsc: return m, tea.Quit - case enter: - m.entered = true + case tea.KeyEnter: + m.inputDone = true return m, tea.Quit - case backspace: - if m.cursor > 0 { - m.password = m.password[:m.cursor-1] + m.password[m.cursor:] - m.cursor-- - } - case left: - if m.cursor > 0 { - m.cursor-- - } - case right: - if m.cursor < len(m.password) { - m.cursor++ - } - default: - // Adds the character entered to the password - m.password = m.password[:m.cursor] + msg.String() + m.password[m.cursor:] - m.cursor++ } } - return m, nil -} - -func (m passwordModel) View() string { - if m.entered { - return "Password received!\n" - } + m.textInput, cmd = m.textInput.Update(msg) - return fmt.Sprintf("Enter your password: %s\n", repeatAsterisks(len(m.password))) + return m, cmd } -// Função para repetir asteriscos -func repeatAsterisks(n int) string { - return strings.Repeat("*", n) +func (m passwordModel) View() string { + return fmt.Sprintf("%s %s\n", m.message, m.textInput.View()) } - -// Example of using -// func main() { -// password, err := Password(InitialPasswordModel()) -// if err != nil { -// fmt.Fprintf(os.Stderr, "Erro: %v\n", err) -// os.Exit(1) -// } -// -// fmt.Printf("%s\n", password) -// } diff --git a/components/mdz/pkg/tui/select.go b/components/mdz/pkg/tui/select.go index e3cb71c9..91aab204 100644 --- a/components/mdz/pkg/tui/select.go +++ b/components/mdz/pkg/tui/select.go @@ -44,18 +44,18 @@ func (m selectModel) Init() tea.Cmd { func (m selectModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) { switch msg := msg.(type) { case tea.KeyMsg: - switch msg.String() { - case "ctrl+c", "q": + switch msg.Type { + case tea.KeyCtrlC, tea.KeyEsc: return m, tea.Quit - case "up", "ctrl+p": + case tea.KeyUp, tea.KeyCtrlP: if m.cursor > 0 { m.cursor-- } - case "down", "ctrl+n": + case tea.KeyDown, tea.KeyCtrlN: if m.cursor < len(m.choices)-1 { m.cursor++ } - case "enter": + case tea.KeyEnter: m.selected = true return m, tea.Quit } @@ -80,14 +80,3 @@ func (m selectModel) View() string { return s } - -// Example of using -// func main() { -// answer, err := Select([]string{"Log in via browser", "Log in via terminal"}) -// if err != nil { -// fmt.Fprintf(os.Stderr, "Error: %v\n", err) -// os.Exit(1) -// } -// -// fmt.Printf("You chose: %s\n", answer) -// } diff --git a/go.mod b/go.mod index 445b565d..88f2759c 100644 --- a/go.mod +++ b/go.mod @@ -5,10 +5,10 @@ go 1.22 toolchain go1.22.0 require ( - github.com/AlecAivazis/survey/v2 v2.3.7 github.com/Masterminds/squirrel v1.5.4 github.com/antlr4-go/antlr/v4 v4.13.1 github.com/casdoor/casdoor-go-sdk v1.1.0 + github.com/charmbracelet/bubbles v0.20.0 github.com/charmbracelet/bubbletea v1.1.1 github.com/go-playground/locales v0.14.1 github.com/go-playground/universal-translator v0.18.1 @@ -29,6 +29,7 @@ require ( require ( github.com/KyleBanks/depth v1.2.1 // indirect + github.com/atotto/clipboard v0.1.4 // indirect github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect github.com/charmbracelet/lipgloss v0.13.0 // indirect github.com/charmbracelet/x/ansi v0.2.3 // indirect @@ -43,14 +44,12 @@ require ( github.com/hashicorp/hcl v1.0.0 // indirect github.com/jackc/puddle/v2 v2.2.2 // indirect github.com/josharian/intern v1.0.0 // indirect - github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect github.com/lann/builder v0.0.0-20180802200727-47ae307949d0 // indirect github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 // indirect github.com/lucasb-eyer/go-colorful v1.2.0 // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-localereader v0.0.1 // indirect - github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect github.com/muesli/cancelreader v0.2.2 // indirect @@ -99,7 +98,6 @@ require ( golang.org/x/crypto v0.27.0 // indirect golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect golang.org/x/sync v0.8.0 // indirect - golang.org/x/term v0.24.0 // indirect golang.org/x/text v0.19.0 gopkg.in/go-playground/assert.v1 v1.2.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect @@ -117,7 +115,7 @@ require ( github.com/lestrrat-go/jwx v1.2.30 github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect - github.com/mattn/go-runewidth v0.0.15 // indirect + github.com/mattn/go-runewidth v0.0.16 // indirect github.com/patrickmn/go-cache v2.1.0+incompatible github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/rivo/uniseg v0.4.7 // indirect diff --git a/go.sum b/go.sum index c025a399..7dc05056 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,3 @@ -github.com/AlecAivazis/survey/v2 v2.3.7 h1:6I/u8FvytdGsgonrYsVn2t8t4QiRnh6QSTqkkhIiSjQ= -github.com/AlecAivazis/survey/v2 v2.3.7/go.mod h1:xUTIdE4KCOIjsBAE1JYsUPoCqYdZ1reCfTwbto0Fduo= github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0= github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/DATA-DOG/go-sqlmock v1.5.2 h1:OcvFkGmslmlZibjAjaHm3L//6LiuBgolP7OputlJIzU= @@ -10,18 +8,20 @@ github.com/Masterminds/squirrel v1.5.4 h1:uUcX/aBc8O7Fg9kaISIUsHXdKuqehiXAMQTYX8 github.com/Masterminds/squirrel v1.5.4/go.mod h1:NNaOrjSoIDfDA40n7sr2tPNZRfjzjA400rg+riTZj10= github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= -github.com/Netflix/go-expect v0.0.0-20220104043353-73e0943537d2 h1:+vx7roKuyA63nhn5WAunQHLTznkw5W8b1Xc0dNjp83s= -github.com/Netflix/go-expect v0.0.0-20220104043353-73e0943537d2/go.mod h1:HBCaDeC1lPdgDeDbhX8XFpy1jqjK0IBG8W5K+xYqA0w= github.com/andybalholm/brotli v1.1.0 h1:eLKJA0d02Lf0mVpIDgYnqXcUn0GqVmEFny3VuID1U3M= github.com/andybalholm/brotli v1.1.0/go.mod h1:sms7XGricyQI9K10gOSf56VKKWS4oLer58Q+mhRPtnY= github.com/antlr4-go/antlr/v4 v4.13.1 h1:SqQKkuVZ+zWkMMNkjy5FZe5mr5WURWnlpmOuzYWrPrQ= github.com/antlr4-go/antlr/v4 v4.13.1/go.mod h1:GKmUxMtwp6ZgGwZSva4eWPC5mS6vUAmOABFgjdkM7Nw= +github.com/atotto/clipboard v0.1.4 h1:EH0zSVneZPSuFR11BlR9YppQTVDbh5+16AmcJi4g1z4= +github.com/atotto/clipboard v0.1.4/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI= github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k= github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8= github.com/bxcodec/dbresolver/v2 v2.2.0 h1:3Xg5Cw64khndjnWYiadP1mL1XU8eVxtkqcDadfihP6k= github.com/bxcodec/dbresolver/v2 v2.2.0/go.mod h1:xWb3HT8vrWUnoLVA7KQ+IcD9RvnzfRBqOkO9rKsg1rQ= github.com/casdoor/casdoor-go-sdk v1.1.0 h1:QW1pMoGG18X+GrcMolKKaTXCLDOpoYCu2kbfUZZQ+5A= github.com/casdoor/casdoor-go-sdk v1.1.0/go.mod h1:cMnkCQJgMYpgAlgEx8reSt1AVaDIQLcJ1zk5pzBaz+4= +github.com/charmbracelet/bubbles v0.20.0 h1:jSZu6qD8cRQ6k9OMfR1WlM+ruM8fkPWkHvQWD9LIutE= +github.com/charmbracelet/bubbles v0.20.0/go.mod h1:39slydyswPy+uVOHZ5x/GjwVAFkCsV8IIVy+4MhzwwU= github.com/charmbracelet/bubbletea v1.1.1 h1:KJ2/DnmpfqFtDNVTvYZ6zpPFL9iRCRr0qqKOCvppbPY= github.com/charmbracelet/bubbletea v1.1.1/go.mod h1:9Ogk0HrdbHolIKHdjfFpyXJmiCzGwy+FesYkZr7hYU4= github.com/charmbracelet/lipgloss v0.13.0 h1:4X3PPeoWEDCMvzDvGmTajSyYPcZM4+y8sCA/SsA3cjw= @@ -31,8 +31,6 @@ github.com/charmbracelet/x/ansi v0.2.3/go.mod h1:dk73KoMTT5AX5BsX0KrqhsTqAnhZZoC github.com/charmbracelet/x/term v0.2.0 h1:cNB9Ot9q8I711MyZ7myUR5HFWL/lc3OpU8jZ4hwm0x0= github.com/charmbracelet/x/term v0.2.0/go.mod h1:GVxgxAbjUrmpvIINHIQnJJKpMlHiZ4cktEQCN6GWyF0= github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/creack/pty v1.1.17 h1:QeVUsEDNrLBW4tMgZHvxy18sKtr6VI492kBhUfhDJNI= -github.com/creack/pty v1.1.17/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= @@ -104,8 +102,6 @@ github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+l github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hinshun/vt10x v0.0.0-20220119200601-820417d04eec h1:qv2VnGeEQHchGaZ/u7lxST/RaJw+cv273q79D81Xbog= -github.com/hinshun/vt10x v0.0.0-20220119200601-820417d04eec/go.mod h1:Q48J4R4DvxnHolD5P8pOtXigYlRuPLGl6moFx3ulM68= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM= @@ -120,8 +116,6 @@ github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= -github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs= -github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= github.com/klauspost/compress v1.17.8 h1:YcnTYrq7MikUT7k0Yb5eceMmALQPYBW/Xltxn0NAMnU= github.com/klauspost/compress v1.17.8/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= @@ -155,19 +149,15 @@ github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0V github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= -github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= -github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-localereader v0.0.1 h1:ygSAOl7ZXTx4RdPYinUpg6W99U8jWvWi9Ye2JC/oIi4= github.com/mattn/go-localereader v0.0.1/go.mod h1:8fBrzywKY7BI3czFoHkuzRoWE9C+EiG4R1k4Cjx5p88= -github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= -github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= -github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b h1:j7+1HpAFS1zy5+Q4qx1fWh90gTKwiN4QCGoY9TWyyO4= -github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= +github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc= +github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/moby/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0= @@ -297,7 +287,6 @@ golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -317,13 +306,10 @@ golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= golang.org/x/term v0.16.0/go.mod h1:yn7UURbUtPyrVJPGPq404EukNFxcm/foM+bV/bfcDsY= -golang.org/x/term v0.24.0 h1:Mh5cbb+Zk2hqqXNO7S1iTjEphVL+jb8ZWaqh/g+JWkM= -golang.org/x/term v0.24.0/go.mod h1:lOBK/LVxemqiMij05LGJ0tzNr8xlmwBRJ81PX6wVLH8= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= -golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=