29 lines
354 B
Go
29 lines
354 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
|
|
"tuxpa.in/t/wm/src/sock"
|
|
)
|
|
|
|
func main() {
|
|
s, err := sock.Client("")
|
|
errExit(err)
|
|
o := os.Args[1:]
|
|
if len(o) == 0 {
|
|
fmt.Println("no arguments given.")
|
|
return
|
|
}
|
|
resp, err := s.Send(o...)
|
|
errExit(err)
|
|
fmt.Print(resp)
|
|
}
|
|
|
|
func errExit(err error) {
|
|
if err != nil {
|
|
fmt.Printf(err.Error())
|
|
os.Exit(1)
|
|
}
|
|
}
|