shell

package
v0.0.0-...-8ad63dc Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2019 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearLine

func ClearLine()

func FormatOutput

func FormatOutput(v *viper.Viper, object interface{}, quotes []string) ([]byte, error)

func PrintHelp

func PrintHelp()

func UpdateLine

func UpdateLine(v *viper.Viper, vars map[string]interface{}, quotes []string, line string) error

Types

type Executor

type Executor struct {
	Vars  map[string]interface{}
	Funcs dfl.FunctionMap
}

type Formatter

type Formatter struct {
	Quotes []string
}

type History

type History struct {
	Lines  []string
	Cursor int
}

func (*History) Back

func (h *History) Back()

func (*History) Empty

func (h *History) Empty() bool

func (*History) Forward

func (h *History) Forward()

func (*History) Get

func (h *History) Get(i int) string

func (*History) Last

func (h *History) Last() string

func (*History) Len

func (h *History) Len() int

func (*History) Line

func (h *History) Line() string

func (*History) Push

func (h *History) Push(line string)

type Shell

type Shell struct {
	History   *History
	Executor  *Executor
	Formatter *Formatter
	Line      string
	Column    int
}

func New

func New() *Shell

func (*Shell) Backspace

func (s *Shell) Backspace()

func (*Shell) CleanLine

func (s *Shell) CleanLine() string

func (*Shell) ClearLine

func (s *Shell) ClearLine()

func (*Shell) CutLine

func (s *Shell) CutLine() error

func (*Shell) Exec

func (s *Shell) Exec(line string) (interface{}, error)

func (*Shell) GetKey

func (s *Shell) GetKey() (rune, keyboard.Key, error)

func (*Shell) MoveLeft

func (s *Shell) MoveLeft()

func (*Shell) MoveRight

func (s *Shell) MoveRight()

func (*Shell) PasteLine

func (s *Shell) PasteLine() error

func (*Shell) PrintExamples

func (s *Shell) PrintExamples()

func (*Shell) PrintFunctions

func (s *Shell) PrintFunctions()

func (*Shell) PrintHeader

func (s *Shell) PrintHeader()

func (*Shell) PrintHelp

func (s *Shell) PrintHelp()

func (*Shell) PrintHistory

func (s *Shell) PrintHistory()

func (*Shell) ResetLine

func (s *Shell) ResetLine()

func (*Shell) SetLine

func (s *Shell) SetLine(str string)

func (*Shell) UpdateScreen

func (s *Shell) UpdateScreen()

func (*Shell) WriteString

func (s *Shell) WriteString(str string)

Jump to

Keyboard shortcuts

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