mirror of https://github.com/chzyer/readline.git
improve readme
This commit is contained in:
parent
93a73361b8
commit
2622435bfa
|
@ -12,7 +12,10 @@ A pure go implementation for gnu readline.
|
||||||
|
|
||||||
# Usage
|
# Usage
|
||||||
|
|
||||||
|
You can read example code in [example/main.go](https://github.com/chzyer/readline/blob/master/example/main.go).
|
||||||
|
|
||||||
* Simplest example
|
* Simplest example
|
||||||
|
|
||||||
```go
|
```go
|
||||||
import "github.com/chzyer/readline"
|
import "github.com/chzyer/readline"
|
||||||
|
|
||||||
|
@ -32,6 +35,7 @@ for {
|
||||||
```
|
```
|
||||||
|
|
||||||
* Example with durable history
|
* Example with durable history
|
||||||
|
|
||||||
```go
|
```go
|
||||||
rl, err := readline.NewEx(&readline.Config{
|
rl, err := readline.NewEx(&readline.Config{
|
||||||
Prompt: "> ",
|
Prompt: "> ",
|
||||||
|
@ -52,6 +56,7 @@ for {
|
||||||
```
|
```
|
||||||
|
|
||||||
* Example with auto refresh
|
* Example with auto refresh
|
||||||
|
|
||||||
```go
|
```go
|
||||||
import (
|
import (
|
||||||
"log"
|
"log"
|
||||||
|
|
Loading…
Reference in New Issue