Hilbish/rl_hilbiline.go

44 lines
791 B
Go
Raw Permalink Normal View History

// +build hilbiline,!goreadline
package main
// Here we define a generic interface for readline and hilbiline,
// making them interchangable during build time
// this is hilbiline's, as is obvious by the filename
import "github.com/Rosettea/Hilbiline"
type lineReader struct {
hl *hilbiline.HilbilineState
}
// other gophers might hate this naming but this is local, shut up
func newLineReader(prompt string) *lineReader {
hl := hilbiline.New(prompt)
return &lineReader{
&hl,
}
}
func (lr *lineReader) Read() (string, error) {
return lr.hl.Read()
}
func (lr *lineReader) SetPrompt(prompt string) {
lr.hl.SetPrompt(prompt)
}
func (lr *lineReader) AddHistory(cmd string) {
return
}
func (lr *lineReader) ClearInput() {
2021-06-09 01:00:01 +00:00
return
}
func (lr *lineReader) Resize() {
return
}