Remove -x from mosquitto_sub - this is provided by -F now.
This commit is contained in:
parent
8140ce1f24
commit
840453c14f
@ -48,7 +48,6 @@ Client library:
|
||||
|
||||
Client:
|
||||
- Add -F to mosquitto_sub to allow the user to choose the output format.
|
||||
- Add -x to mosquitto_sub for printing the payload in hexadecimal format.
|
||||
- Add -U to mosquitto_sub for unsubscribing from topics.
|
||||
- Add --retained-only to mosquitto_sub to exit after receiving all retained
|
||||
messages.
|
||||
|
@ -853,11 +853,6 @@ int client_config_line_proc(struct mosq_config *cfg, int pub_or_sub, int argc, c
|
||||
goto unknown_option;
|
||||
}
|
||||
cfg->verbose = 1;
|
||||
}else if(!strcmp(argv[i], "-x")){
|
||||
if(pub_or_sub == CLIENT_PUB){
|
||||
goto unknown_option;
|
||||
}
|
||||
cfg->hex_output = true;
|
||||
}else{
|
||||
goto unknown_option;
|
||||
}
|
||||
|
@ -82,7 +82,6 @@ struct mosq_config {
|
||||
int unsub_topic_count; /* sub */
|
||||
bool verbose; /* sub */
|
||||
bool eol; /* sub */
|
||||
bool hex_output; /* sub */
|
||||
int msg_count; /* sub */
|
||||
char *format; /* sub */
|
||||
#ifdef WITH_SOCKS
|
||||
|
@ -34,19 +34,6 @@ Contributors:
|
||||
bool process_messages = true;
|
||||
int msg_count = 0;
|
||||
|
||||
static void write_payload(const unsigned char *payload, int payloadlen, bool hex)
|
||||
{
|
||||
int i;
|
||||
|
||||
if(!hex){
|
||||
(void)fwrite(payload, 1, payloadlen, stdout);
|
||||
}else{
|
||||
for(i=0; i<payloadlen; i++){
|
||||
fprintf(stdout, "%x", payload[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static int get_time(struct tm **ti, long *ns)
|
||||
{
|
||||
#ifdef WIN32
|
||||
@ -79,6 +66,19 @@ static int get_time(struct tm **ti, long *ns)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void write_payload(const unsigned char *payload, int payloadlen, bool hex)
|
||||
{
|
||||
int i;
|
||||
|
||||
if(!hex){
|
||||
(void)fwrite(payload, 1, payloadlen, stdout);
|
||||
}else{
|
||||
for(i=0; i<payloadlen; i++){
|
||||
fprintf(stdout, "%x", payload[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void write_json_payload(const char *payload, int payloadlen)
|
||||
{
|
||||
int i;
|
||||
@ -290,7 +290,7 @@ void print_message(struct mosq_config *cfg, const struct mosquitto_message *mess
|
||||
}else if(cfg->verbose){
|
||||
if(message->payloadlen){
|
||||
printf("%s ", message->topic);
|
||||
write_payload(message->payload, message->payloadlen, cfg->hex_output);
|
||||
write_payload(message->payload, message->payloadlen, false);
|
||||
if(cfg->eol){
|
||||
printf("\n");
|
||||
}
|
||||
@ -302,7 +302,7 @@ void print_message(struct mosq_config *cfg, const struct mosquitto_message *mess
|
||||
fflush(stdout);
|
||||
}else{
|
||||
if(message->payloadlen){
|
||||
write_payload(message->payload, message->payloadlen, cfg->hex_output);
|
||||
write_payload(message->payload, message->payloadlen, false);
|
||||
if(cfg->eol){
|
||||
printf("\n");
|
||||
}
|
||||
@ -407,7 +407,7 @@ void print_usage(void)
|
||||
printf(" [-A bind_address]\n");
|
||||
#endif
|
||||
printf(" [-i id] [-I id_prefix]\n");
|
||||
printf(" [-d] [-N] [--quiet] [-v] [-x]\n");
|
||||
printf(" [-d] [-N] [--quiet] [-v]\n");
|
||||
printf(" [--will-topic [--will-payload payload] [--will-qos qos] [--will-retain]]\n");
|
||||
#ifdef WITH_TLS
|
||||
printf(" [{--cafile file | --capath dir} [--cert file] [--key file]\n");
|
||||
@ -448,7 +448,6 @@ void print_usage(void)
|
||||
printf(" -v : print published messages verbosely.\n");
|
||||
printf(" -V : specify the version of the MQTT protocol to use when connecting.\n");
|
||||
printf(" Can be mqttv31 or mqttv311. Defaults to mqttv31.\n");
|
||||
printf(" -x : print published message payloads as hexadecimal data.\n");
|
||||
printf(" --help : display this message.\n");
|
||||
printf(" --quiet : don't print error messages.\n");
|
||||
printf(" --retained-only : only handle messages with the retained flag set, and exit when the\n");
|
||||
|
@ -50,7 +50,6 @@
|
||||
<arg choice='opt' rep='repeat'><option>-U</option> <replaceable>unsub-topic</replaceable></arg>
|
||||
<arg><option>-v</option></arg>
|
||||
<arg><option>-V</option> <replaceable>protocol-version</replaceable></arg>
|
||||
<arg><option>-x</option></arg>
|
||||
<arg><option>--proxy</option> <replaceable>socks-url</replaceable></arg>
|
||||
<arg><option>--quiet</option></arg>
|
||||
<arg>
|
||||
@ -546,13 +545,6 @@
|
||||
the client disconnects unexpectedly.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><option>-x</option></term>
|
||||
<listitem>
|
||||
<para>Print published message payloads as hexadecimal
|
||||
data.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user