readlineutil

package module
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotSupported = errors.New("not supported")

Functions

This section is empty.

Types

type Option

type Option func(*conf)

func WithHistoryFile

func WithHistoryFile(filename string) Option

WithHistoryFile configures a filename to be used to persist the command history.

type Term

type Term struct {
	io.Writer
	// contains filtered or unexported fields
}

func NewTerm

func NewTerm(options ...Option) (*Term, error)

NewTerm wraps a chzyer/readline.Instance so that it can be used in a way similar to bufio.Scanner. NewTerm does not check whether os.Stdin actually is a terminal. A nil Term and ErrNotSupported are returned in case NewTerm is called with TERM environment variable set to dumb.

func (*Term) Close

func (t *Term) Close() error

func (*Term) Err

func (t *Term) Err() error

func (*Term) Scan

func (t *Term) Scan() bool

func (*Term) Text

func (t *Term) Text() string

func (*Term) WritePrompt

func (t *Term) WritePrompt(p string) error

Jump to

Keyboard shortcuts

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