2017-11-23 10:21:28 +08:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
2017-12-30 23:49:55 +08:00
|
|
|
"gitee.com/johng/gf/g/os/gcmd"
|
2017-11-23 10:21:28 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
func doEcho() {
|
|
|
|
fmt.Println("do echo")
|
|
|
|
}
|
|
|
|
|
|
|
|
func main() {
|
2017-12-30 23:49:55 +08:00
|
|
|
fmt.Println(gcmd.Value.GetAll())
|
2017-11-23 10:21:28 +08:00
|
|
|
|
2018-04-17 14:20:02 +08:00
|
|
|
fmt.Println(gcmd.Value.Get(1))
|
2017-11-23 10:21:28 +08:00
|
|
|
|
2017-12-30 23:49:55 +08:00
|
|
|
gcmd.BindHandle("echo", doEcho)
|
|
|
|
gcmd.RunHandle("echo")
|
2017-11-23 10:21:28 +08:00
|
|
|
|
2017-12-30 23:49:55 +08:00
|
|
|
gcmd.AutoRun()
|
2017-11-23 10:21:28 +08:00
|
|
|
}
|