github.com/ActiveState/cli@v0.0.0-20240508170324-6801f60cd051/internal/prompt/overrides.go (about)

     1  package prompt
     2  
     3  import (
     4  	"gopkg.in/AlecAivazis/survey.v1"
     5  )
     6  
     7  type Select struct {
     8  	*survey.Select
     9  }
    10  
    11  func (s *Select) Cleanup(interface{}) error {
    12  	s.NewCursor().NextLine(1)
    13  	return nil
    14  }
    15  
    16  type Input struct {
    17  	*survey.Input
    18  }
    19  
    20  func (i *Input) Cleanup(val interface{}) error {
    21  	i.NewCursor().NextLine(1)
    22  	return nil
    23  }
    24  
    25  type Password struct {
    26  	*survey.Password
    27  }
    28  
    29  func (i *Password) Cleanup(val interface{}) error {
    30  	i.NewCursor().NextLine(1)
    31  	return nil
    32  }
    33  
    34  type Confirm struct {
    35  	*survey.Confirm
    36  }
    37  
    38  func (s *Confirm) Cleanup(interface{}) error {
    39  	s.NewCursor().NextLine(1)
    40  	// Keep the answer
    41  	return nil
    42  }