history

package
v0.0.0-...-e081c89 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2024 License: GPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExpandVariables

func ExpandVariables(line []rune, rl *readline.Instance) ([]rune, error)

ExpandVariables finds all history variables and replaces them with the value of the variable

func ExpandVariablesInLine

func ExpandVariablesInLine(line []rune, rl *readline.Instance) ([]rune, error)

ExpandVariablesInLine finds history variables in a line and replaces it with the value of the variable. It does not replace the line formatting variables.

Types

type History

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

History exports common functions needed for shell history

func New

func New(filename string) (h *History, err error)

New creates a History object

func (*History) Dump

func (h *History) Dump() interface{}

Dump returns the entire history file

func (*History) GetLine

func (h *History) GetLine(i int) (string, error)

GetLine returns a specific line from the history file

func (*History) Len

func (h *History) Len() int

Len returns the number of items in the history file

func (*History) Write

func (h *History) Write(s string) (int, error)

Write item to history file. eg ~/.murex_history

type Item

type Item struct {
	Index    int
	DateTime time.Time
	Block    string
}

Item is the structure of an individual item in the History.list slice

Jump to

Keyboard shortcuts

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