mosquitto_sub `--watch` can now be called as `-w`.

pull/2229/head
Roger A. Light 4 years ago
parent e4160b083a
commit de0e275ccb

@ -55,7 +55,7 @@ Clients:
that instance. This is useful for negating TLS options provided in a config that instance. This is useful for negating TLS options provided in a config
file, or to disable the automatic use of TLS when using port 8883. file, or to disable the automatic use of TLS when using port 8883.
Closes #2180. Closes #2180.
- Add `--watch` to mosquitto_sub which means messages will be printed on a - Add `-w`/`--watch` to mosquitto_sub which means messages will be printed on a
fixed line number based on the topic and order in which messages were fixed line number based on the topic and order in which messages were
received. Requires ANSI escape code support in the terminal. received. Requires ANSI escape code support in the terminal.

@ -43,7 +43,7 @@ u - PUB,RR,SUB (username)
V - PUB,RR,SUB (version output) V - PUB,RR,SUB (version output)
v - RR,SUB (verbose) v - RR,SUB (verbose)
W - SUB (timeout) W - SUB (timeout)
w w - SUB (watch)
X X
x - PUB,RR,SUB (session-expiry-interval) x - PUB,RR,SUB (session-expiry-interval)
Y Y

@ -1198,7 +1198,7 @@ int client_config_line_proc(struct mosq_config *cfg, int pub_or_sub, int argc, c
} }
i++; i++;
} }
}else if(!strcmp(argv[i], "--watch")){ }else if(!strcmp(argv[i], "-w") || !strcmp(argv[i], "--watch")){
if(pub_or_sub != CLIENT_SUB){ if(pub_or_sub != CLIENT_SUB){
goto unknown_option; goto unknown_option;
} }

@ -205,7 +205,7 @@ static void print_usage(void)
printf(" [-A bind_address] [--nodelay]\n"); printf(" [-A bind_address] [--nodelay]\n");
#endif #endif
printf(" [-i id] [-I id_prefix]\n"); printf(" [-i id] [-I id_prefix]\n");
printf(" [-d] [-N] [--quiet] [-v] [--watch]\n"); printf(" [-d] [-N] [--quiet] [-v] [-w|--watch]\n");
printf(" [--will-topic [--will-payload payload] [--will-qos qos] [--will-retain]]\n"); printf(" [--will-topic [--will-payload payload] [--will-qos qos] [--will-retain]]\n");
#ifdef WITH_TLS #ifdef WITH_TLS
printf(" [--no-tls]\n"); printf(" [--no-tls]\n");
@ -263,6 +263,9 @@ static void print_usage(void)
#ifndef WIN32 #ifndef WIN32
printf(" -W : Specifies a timeout in seconds how long to process incoming MQTT messages.\n"); printf(" -W : Specifies a timeout in seconds how long to process incoming MQTT messages.\n");
#endif #endif
printf(" -w : messages will be printed on a fixed line number based on the topic and order in\n");
printf(" which topics are received. Useful for monitoring multiple topics that have\n");
printf(" single line payloads.\n");
printf(" -x : Set the session-expiry-interval property on the CONNECT packet. Applies to MQTT v5\n"); printf(" -x : Set the session-expiry-interval property on the CONNECT packet. Applies to MQTT v5\n");
printf(" clients only. Set to 0-4294967294 to specify the session will expire in that many\n"); printf(" clients only. Set to 0-4294967294 to specify the session will expire in that many\n");
printf(" seconds after the client disconnects, or use -1, 4294967295, or ∞ for a session\n"); printf(" seconds after the client disconnects, or use -1, 4294967295, or ∞ for a session\n");
@ -282,9 +285,6 @@ static void print_usage(void)
printf(" Use -T to filter out messages you do not want to be cleared.\n"); printf(" Use -T to filter out messages you do not want to be cleared.\n");
printf(" --unix : connect to a broker through a unix domain socket instead of a TCP socket,\n"); printf(" --unix : connect to a broker through a unix domain socket instead of a TCP socket,\n");
printf(" e.g. /tmp/mosquitto.sock\n"); printf(" e.g. /tmp/mosquitto.sock\n");
printf(" --watch : messages will be printed on a fixed line number based on the topic and order in\n");
printf(" which topics are received. Useful for monitoring multiple topics that have\n");
printf(" single line payloads.\n");
printf(" --will-payload : payload for the client Will, which is sent by the broker in case of\n"); printf(" --will-payload : payload for the client Will, which is sent by the broker in case of\n");
printf(" unexpected disconnection. If not given and will-topic is set, a zero\n"); printf(" unexpected disconnection. If not given and will-topic is set, a zero\n");
printf(" length message will be sent.\n"); printf(" length message will be sent.\n");

@ -60,7 +60,10 @@
<arg><option>-x</option> <replaceable>session-expiry-interval</replaceable></arg> <arg><option>-x</option> <replaceable>session-expiry-interval</replaceable></arg>
<arg><option>--proxy</option> <replaceable>socks-url</replaceable></arg> <arg><option>--proxy</option> <replaceable>socks-url</replaceable></arg>
<arg><option>--quiet</option></arg> <arg><option>--quiet</option></arg>
<arg><option>--watch</option></arg> <group choice='opt'>
<arg choice='plain'><option>-w</option></arg>
<arg choice='plain'><option>--watch</option></arg>
</group>
<arg> <arg>
<option>--will-topic</option> <replaceable>topic</replaceable> <option>--will-topic</option> <replaceable>topic</replaceable>
<arg><option>--will-payload</option> <replaceable>payload</replaceable></arg> <arg><option>--will-payload</option> <replaceable>payload</replaceable></arg>
@ -803,6 +806,7 @@ mosquitto_sub -t 'bbc/#' -T bbc/bbc1 --remove-retained</programlisting>
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term><option>-w</option></term>
<term><option>--watch</option></term> <term><option>--watch</option></term>
<listitem> <listitem>
<para> <para>

Loading…
Cancel
Save