-
Notifications
You must be signed in to change notification settings - Fork 0
/
brokerc.go
39 lines (37 loc) · 846 Bytes
/
brokerc.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package main
import (
"github.com/urfave/cli"
"os"
)
func main() {
initLogger(false)
cli.HelpFlag = cli.BoolFlag{
Name: "help",
Usage: "show help",
}
cli.VersionFlag = cli.BoolFlag{
Name: "version",
Usage: "print the version",
}
app := cli.NewApp()
app.Writer = os.Stdout
app.ErrWriter = os.Stderr
app.Name = "brokerc"
app.HelpName = "brokerc"
app.Usage = "brokerc is a cross-platform publish and subscribe command line client tool, including mqtt client, amqp client, kafka client, http client."
app.Version = "v1.0.2"
app.Commands = []cli.Command{
MQTTPublishCommand,
MQTTSubscribeCommand,
AMQPSubscribeCommand,
AMQPPublishCommand,
KafkaPublishCommand,
KafkaSubscribeCommand,
HTTPPublishCommand,
HTTPSubscribeCommand,
}
if err := app.Run(os.Args); err != nil {
logger.Error(err)
os.Exit(0)
}
}