mirror of
https://github.com/go-sylixos/elvish.git
synced 2024-12-14 02:57:52 +08:00
Add _tests/cli.
This commit is contained in:
parent
0ff21a8b32
commit
3927f7cf75
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user