Host parameter ignored
Magnum5234 opened this issue · comments
Magnum5234 commented
Hey, thx for this tool :)
The host parameter is completely ignored.
% mqttcli pub -h 10.10.5.20 -t 'test' -m 'test message' -d
INFO[0000] Broker URI: tcp://localhost:1883
INFO[0000] connecting...
INFO[0000] Topic: test
INFO[0000] client connected
INFO[0000] Published
INFO[0000] client disconnected
If fixed this by changing
https://github.com/shirou/mqttcli/blob/master/mqtt.go#L123
to
host := c.String("h")
shirou commented
Kevin Garman commented
My thanks as well, this is exactly what I was looking for!
The -h/--host parameter isn't working for me either....the config file works fine:
./mqttcli_linux_amd64 pub -d -h "192.168.101.25" -p "1883" -t "test/kg" -m "1"
INFO[0000] Broker URI: tcp://localhost:1883
INFO[0000] connecting...
ERRO[0000] network Error : dial tcp 127.0.0.1:1883: connect: connection refused
./mqttcli_linux_amd64 pub -d --host "192.168.101.25" -p "1883" -t "test/kg" -m "1"
Incorrect Usage: flag provided but not defined: -host
shirou commented
I noticed 0.1.0 release binaries do not include this host
alias flag. I have released 0.2.0. Please try to use that version.
Kevin Garman commented
Yep, works for me....thanks!