CLI for Websocket.
Download from Release Page (may not be the latest)
or
go get github.com/morikuni/weso/cmd/weso
$ cat template.txt
{{define "Name"}}{"name": "{{._1}}"}{{end}}
{{define "Decorate"}}{{._1}}{{._2}}{{._1}}{{end}}
{{define "Twice"}}{{._1}}{{._1}}{{end}}
$ weso -template template.txt ws://echo.websocket.org
> hello
<< hello
> .Name Jack
<< {"name": "Jack"}
> .Decorate *** "I'm Jack"
<< ***I'm Jack***
> .Twice Hello
<< HelloHello
Start line with dot .
to use template.
Template file is written in Go's standard template library.
Arguments for template are expanded to ._1
, ._2
... ._N
.
weso uses
- Liner for line editor.