Documentation ¶
Overview ¶
Package list for interactive CLI list
Index ¶
- Constants
- Variables
- func GetWith(name string, options []string) string
- type Colors
- type List
- func (list *List) ClearOptions()
- func (list *List) Enter() string
- func (list *List) Exit()
- func (list *List) Get() string
- func (list *List) HighlightDown() *List
- func (list *List) HighlightUp() *List
- func (list *List) PrintHead() int
- func (list *List) PrintHighlight(element string) int
- func (list *List) PrintOption(option string) int
- func (list *List) PrintResult(result string) int
- func (list *List) Println() int
- func (list *List) SetChooser(chooser string)
- func (list *List) SetColors(colors *Colors)
- func (list *List) SetIndent(indent int)
- func (list *List) SetPrint(print Printer)
- func (list *List) Show() int
- func (list *List) ShowOptions() int
- type Printer
Constants ¶
View Source
const ( // HideCursor ASCII sequence to hide cursor HideCursor = "\033[?25l" // ShowCursor ASCII sequence for show cursor ShowCursor = "\033[?25h" )
Variables ¶
View Source
var DefaultColors = &Colors{ Head: color.New(color.FgWhite, color.Bold), Option: color.New(color.FgWhite), Highlight: color.New(color.FgCyan), }
DefaultColors which will be used by default
Functions ¶
Types ¶
type List ¶
type List struct { Index int Print Printer Cursor *curse.Cursor // contains filtered or unexported fields }
List base struct
func (*List) ClearOptions ¶
func (list *List) ClearOptions()
ClearOptions clears options from console
func (*List) HighlightDown ¶
HighlightDown highlights option below
func (*List) HighlightUp ¶
HighlightUp highlights option above
func (*List) PrintHighlight ¶
PrintHighlight prints highlighted list element
func (*List) PrintOption ¶
PrintOption prints list option
func (*List) PrintResult ¶
PrintResult prints list header and choosen option
func (*List) SetChooser ¶
SetChooser sets chooser string i.e. " ❯ "
Click to show internal directories.
Click to hide internal directories.