func (sa *SelectWithAdd) Run() (int, string, error) {
	if len(sa.Items) > 0 {
		newItems := append([]string{sa.AddLabel}, sa.Items...)

		s := Select{
			Label: sa.Label,
			Items: newItems,
		}

		selected, value, err := s.innerRun(1, '+')
		if err != nil || selected != 0 {
			return selected - 1, value, err
		}

		// XXX run through terminal for windows
		os.Stdout.Write([]byte(upLine(1) + "\r" + clearLine))
	}

	p := Prompt{
		Label:    sa.AddLabel,
		Validate: sa.Validate,
	}
	value, err := p.Run()
	return SelectedAdd, value, err
}
// Run runs the Select list. It returns the index of the selected element,
// and its value. If a new element is created, -1 is returned as the index.
Run runs the Select list. It returns the index of the selected element,
and its value. If a new element is created, -1 is returned as the index.
// Run runs the Select list . It returns the index of the selected element // and its value . If a new element is created - 1 is returned as the index .
func (sa *SelectWithAdd) Run() (int, string, error) {
	if len(sa.Items) > 0 {
		newItems := append([]string{sa.AddLabel}, sa.Items...)
		s := Select{
			Label: sa.Label,
			Items: newItems,
		}
		selected, value, err := s.innerRun(1, '+')
		if err != nil || selected != 0 {
			return selected - 1, value, err
		}
		os.Stdout.Write([]byte(upLine(1) + "\r" + clearLine))
	}
	p := Prompt{
		Label:    sa.AddLabel,
		Validate: sa.Validate,
	}
	value, err := p.Run()
	return SelectedAdd, value, err
}
func ( sa * SelectWithAdd ) Run ( ) ( int , string , error ) { if len ( sa . Items ) > 0 { newItems := append ( [ ] string { sa . AddLabel } , sa . Items ... ) s := Select { Label : sa . Label , Items : newItems , } selected , value , err := s . innerRun ( 1 , '+' ) if err != nil || selected != 0 { return selected - 1 , value , err } os . Stdout . Write ( [ ] byte ( upLine ( 1 ) + " \r " + clearLine ) ) } p := Prompt { Label : sa . AddLabel , Validate : sa . Validate , } value , err := p . Run ( ) return SelectedAdd , value , err }
Run runs the Select list.
Run runs the Select list .
// XXX run through terminal for windows