Skip to content

0-T-0/esionenil.og

 
 

Repository files navigation

Go-Linenoise

2014-10-27可用

Go语言的linenoise包装,附带了原来所有的C源代码

My Golang binding of linenoise, with all C code inside and modified for go-callback

下载后,需要把目录名从go-linenoise手工改成linenosie,才能使用,切记切记

After Download, rename go-linenoise to linenoise, for install and use

Linenoise

或许很多人知道readline,一个命令行编辑库,Bash,Mysql,Mutt都在使用。Antirez(Redis的作者)编写了一个更加轻量级的行编辑库,只有一千多行,就实现了在命令行上移动、增删、复制、粘贴、搜索等功能,用于Redis/MongoDB/Andriod。

通过linenoise,你可以完成这些功能:

  • 上下方向键切换历史命令
  • ctrl+r 可以搜索历史命令,很常用的一个
  • ctrl+a 到行首
  • ctrl+e 到行尾
  • ctrl+u 删除到行首
  • ctrl+k 删除到行尾
  • ctrl+l 类似 clear 命令效果
  • ctrl+y 粘贴

Example

$ cd example
$ go build
$ ./example

About

golang binding of c lib linenoise(writtern by antirez)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 89.4%
  • Go 6.7%
  • Makefile 3.1%
  • Shell 0.8%