vorl

package module
v0.0.18 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

README

vorl

A very opinionated REPL lib

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandResultEmpty added in v0.0.9

type CommandResultEmpty struct{}

type CommandResultList

type CommandResultList struct {
	List     []string
	OnSelect func(selected string) interface{}
}

type CommandResultSaveTo added in v0.0.9

type CommandResultSaveTo struct {
	File   string
	Result interface{}
}

type CommandResultSimple

type CommandResultSimple string

type CommandResultTable

type CommandResultTable struct {
	Table    [][]string
	OnSelect func(selected []string) interface{}
}

type Interpreter

type Interpreter interface {
	Exec(command string) (interface{}, error)

	Suggest(partialInput string) []string
}

type REPL

type REPL struct {
	// contains filtered or unexported fields
}

func NewREPL

func NewREPL(interpreter Interpreter, prompt string, historyFile string) (*REPL, error)

func (*REPL) Run

func (r *REPL) Run() error

func (*REPL) RunNonInteractive added in v0.0.15

func (r *REPL) RunNonInteractive(command string) error

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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