2021-05-17 23:03:56 +00:00
|
|
|
// +build hilbiline
|
|
|
|
|
2021-10-16 15:31:01 +00:00
|
|
|
package main
|
|
|
|
|
2021-05-17 23:03:56 +00:00
|
|
|
// 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
|
|
|
|
|
2021-06-03 23:19:22 +00:00
|
|
|
import "github.com/Rosettea/Hilbiline"
|
2021-05-17 23:03:56 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|
2021-06-09 01:00:01 +00:00
|
|
|
func (lr *LineReader) ClearInput() {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2021-11-22 15:41:27 +00:00
|
|
|
func (lr *LineReader) Resize() {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|