Add _tests/cli.

This commit is contained in:
Qi Xiao 2019-04-26 23:20:21 +01:00
parent 0ff21a8b32
commit 3927f7cf75

View File

@ -1,5 +1,27 @@
// A test program for the cli package.
package main
import (
"fmt"
"io"
"github.com/elves/elvish/cli/clicore"
)
func main() {
app := clicore.NewAppFromStdIO()
for {
code, err := app.ReadCode()
if err != nil {
if err != io.EOF {
fmt.Println("error:", err)
}
break
}
fmt.Println("got:", code)
if code == "exit" {
fmt.Println("bye")
break
}
}
}