improve readme

This commit is contained in:
Cheney 2015-09-23 13:26:42 +08:00
parent cf3342ccf3
commit 97dbc9e329
1 changed files with 20 additions and 0 deletions

View File

@ -10,6 +10,26 @@ A pure go implementation for gnu readline.
![demo](https://raw.githubusercontent.com/chzyer/readline/master/example/demo.gif) ![demo](https://raw.githubusercontent.com/chzyer/readline/master/example/demo.gif)
# Usage
```go
import "github.com/chzyer/readline"
rl, err := readline.New("> ")
if err != nil {
panic(err)
}
defer rl.Close()
for {
line, err := rl.Readline()
if err != nil { // io.EOF
break
}
println(line)
}
```
# Shortcut # Shortcut
`Meta`+`B` means press `Esc` and `n` separately. `Meta`+`B` means press `Esc` and `n` separately.