shell

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExecCommandType

type ExecCommandType func(command string) bool

type ExecSuggestionType

type ExecSuggestionType func(in string, count int) bool

type HistoryHandler

type HistoryHandler struct {
	Queue []string
	// contains filtered or unexported fields
}

func NewHistoryHandler

func NewHistoryHandler(max uint, autosave bool) *HistoryHandler

func (*HistoryHandler) AddToHistory

func (h *HistoryHandler) AddToHistory(data string)

func (*HistoryHandler) Clear

func (h *HistoryHandler) Clear()

func (*HistoryHandler) GetHistory

func (h *HistoryHandler) GetHistory() []string

func (*HistoryHandler) GetHistoryAtPos

func (h *HistoryHandler) GetHistoryAtPos(pos int) (string, bool)

func (*HistoryHandler) GetHistoryNext

func (h *HistoryHandler) GetHistoryNext() (string, bool)

func (*HistoryHandler) GetHistoryPrev

func (h *HistoryHandler) GetHistoryPrev() (string, bool)

func (*HistoryHandler) SetDefault

func (h *HistoryHandler) SetDefault(def string)

func (*HistoryHandler) SetEnabled

func (h *HistoryHandler) SetEnabled(enabled bool)

type Shell

type Shell struct {
	ExecSuggestion ExecSuggestionType
	ExecCommand    ExecCommandType
	// contains filtered or unexported fields
}

func NewShell

func NewShell(auth interfaces.IAuthenticator, terminal interfaces.ITerminal, prompt string, autosave bool) *Shell

func (*Shell) ClearHistory

func (c *Shell) ClearHistory()

func (*Shell) DoNext

func (c *Shell) DoNext()

func (*Shell) DoRedraw

func (c *Shell) DoRedraw(line string)

func (*Shell) GetHistory

func (c *Shell) GetHistory() string

func (*Shell) GetHistoryAtPos

func (c *Shell) GetHistoryAtPos(idx int) (string, bool)

func (*Shell) KeyEvent

func (c *Shell) KeyEvent(event *interfaces.KeyData) bool

func (*Shell) SetHistoryDefault

func (c *Shell) SetHistoryDefault(data string)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL