repl

package
v0.0.0-...-1adbf8b Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SubCmdComp

func SubCmdComp(cmd *cobra.Command) func(str string) []Item

Types

type CompFunc

type CompFunc func(str string) []Item

type History

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

func GetHistory

func GetHistory() *History

func NewHistory

func NewHistory(max int) *History

func (*History) Add

func (h *History) Add(e string)

func (*History) Clear

func (h *History) Clear()

func (History) Entries

func (h History) Entries() []string

func (*History) Load

func (h *History) Load(path string) error

func (History) Save

func (h History) Save(path string) error

func (History) WriteTo

func (h History) WriteTo(w io.Writer) (n int64, err error)

type Item

type Item struct {
	View    string
	Content string
}

func NoComp

func NoComp(string) []Item

func PathComp

func PathComp(path string) []Item

PathComp returns directory entries matching the given path prefix. The path before the last path separator is used as base directory. If path is not absolute, then the path is resolved relatively to the working directory. If an I/O error occurs, no items are returned.

func (Item) String

func (i Item) String() string

Jump to

Keyboard shortcuts

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