Rich Enhanced Shell History - Contextual shell history for zsh and bash
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
resh/internal/histcli/histcli.go

30 lines
585 B

package histcli
import (
"github.com/curusarn/resh/internal/recordint"
)
// Histcli is a dump of history preprocessed for resh cli purposes
type Histcli struct {
// list of records
List []recordint.SearchApp
}
// New Histcli
func New() Histcli {
return Histcli{}
}
// AddRecord to the histcli
func (h *Histcli) AddRecord(rec *recordint.Indexed) {
cli := recordint.NewSearchApp(rec)
h.List = append(h.List, cli)
}
// AddCmdLine to the histcli
func (h *Histcli) AddCmdLine(cmdline string) {
cli := recordint.NewSearchAppFromCmdLine(cmdline)
h.List = append(h.List, cli)
}