gocli

package
v1.0.14 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 11, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Terminal

type Terminal struct {
	Styles          TerminalStyles
	Commands        []gt.Command
	BypassCharacter string
	CtrlKeys        []byte
	// contains filtered or unexported fields
}

func (*Terminal) CleanCurrentLine added in v1.0.13

func (t *Terminal) CleanCurrentLine()

func (*Terminal) CleanNextLines added in v1.0.13

func (t *Terminal) CleanNextLines(lines int)

func (*Terminal) ClearHistory added in v1.0.9

func (t *Terminal) ClearHistory()

func (*Terminal) CopyToClipboard added in v1.0.10

func (t *Terminal) CopyToClipboard(userInput string)

func (*Terminal) CountHistory added in v1.0.9

func (t *Terminal) CountHistory() int

func (*Terminal) FnClearScreen added in v1.0.10

func (t *Terminal) FnClearScreen()

func (*Terminal) FnDeleteLastLine added in v1.0.10

func (t *Terminal) FnDeleteLastLine()

func (*Terminal) FnExitProgram added in v1.0.10

func (t *Terminal) FnExitProgram()

func (*Terminal) Get

func (t *Terminal) Get(data ...string) TerminalResponse

func (*Terminal) GetAdjustedLine added in v1.0.13

func (t *Terminal) GetAdjustedLine(items []string, separator string) (string, int)

func (*Terminal) GetHistory added in v1.0.9

func (t *Terminal) GetHistory(index int) []string

func (*Terminal) GetHistoryAt added in v1.0.9

func (t *Terminal) GetHistoryAt(index int) (string, error)

func (*Terminal) PasteClipboard added in v1.0.10

func (t *Terminal) PasteClipboard(userInput *string)

func (*Terminal) PrintError added in v1.0.10

func (t *Terminal) PrintError(text string, params ...any)

func (*Terminal) PrintHistory added in v1.0.9

func (t *Terminal) PrintHistory(limit int)

func (*Terminal) PrintInfo added in v1.0.10

func (t *Terminal) PrintInfo(text string, params ...any)

func (*Terminal) PrintSuccess added in v1.0.10

func (t *Terminal) PrintSuccess(text string, params ...any)

func (*Terminal) PrintText added in v1.0.10

func (t *Terminal) PrintText(text string, params ...any)

func (*Terminal) PrintWarning added in v1.0.10

func (t *Terminal) PrintWarning(text string, params ...any)

type TerminalResponse

type TerminalResponse struct {
	Command  string
	Params   map[string]interface{}
	RawInput string
	Type     TerminalResponseType
	CtrlKey  byte
	Error    error
}

func (*TerminalResponse) GetParam added in v1.0.9

func (tr *TerminalResponse) GetParam(name string, defaultValue interface{}) interface{}

type TerminalResponseType

type TerminalResponseType int
const (
	Cmd TerminalResponseType = iota
	OsCmd
	CtrlKey
	CmdHelp
	CmdError
	ParamError
	ExecutionError
)

type TerminalStyles added in v1.0.10

type TerminalStyles struct {
	Prompt                 string
	PromptColor            gu.Color
	ForegroundColor        gu.Color
	ForegroundSuggestions  gu.Color
	BackgroundColor        gu.BgColor
	SelForegroundColor     gu.Color
	SelBackgroundColor     gu.BgColor
	HelpTextForeground     gu.Color
	HelpTitlesForeground   gu.Color
	HelpCommandForeground  gu.Color
	HelpParamsForeground   gu.Color
	HelpRequiredForeground gu.Color
	HelpLineColor          gu.Color
	Cursor                 gu.Cursor
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳