diff --git a/client/client_shared.c b/client/client_shared.c index 5b73bfe1..343bb07e 100644 --- a/client/client_shared.c +++ b/client/client_shared.c @@ -394,8 +394,10 @@ int client_config_line_proc(struct mosq_config *cfg, int pub_or_sub, int argc, c }else{ cfg->pub_mode = MSGMODE_STDIN_FILE; } +#ifdef WITH_SRV }else if(!strcmp(argv[i], "-S")){ cfg->use_srv = true; +#endif }else if(!strcmp(argv[i], "-t") || !strcmp(argv[i], "--topic")){ if(i==argc-1){ fprintf(stderr, "Error: -t argument given but no topic specified.\n\n"); diff --git a/client/pub_client.c b/client/pub_client.c index 3a0c8972..60842e9f 100644 --- a/client/pub_client.c +++ b/client/pub_client.c @@ -201,7 +201,11 @@ void print_usage(void) printf("mosquitto_pub is a simple mqtt client that will publish a message on a single topic and exit.\n"); printf("mosquitto_pub version %s running on libmosquitto %d.%d.%d.\n\n", VERSION, major, minor, revision); printf("Usage: mosquitto_pub [-h host] [-p port] [-q qos] [-r] {-f file | -l | -n | -m message} -t topic\n"); +#ifdef WITH_SRV printf(" [-A bind_address] [-S]\n"); +#else + printf(" [-A bind_address]\n"); +#endif printf(" [-i id] [-I id_prefix]\n"); printf(" [-d] [--quiet]\n"); printf(" [-M max_inflight]\n"); @@ -231,7 +235,9 @@ void print_usage(void) printf(" -q : quality of service level to use for all messages. Defaults to 0.\n"); printf(" -r : message should be retained.\n"); printf(" -s : read message from stdin, sending the entire input as a message.\n"); +#ifdef WITH_SRV printf(" -S : use SRV lookups to determine which host to connect to.\n"); +#endif printf(" -t : mqtt topic to publish to.\n"); printf(" -u : provide a username (requires MQTT 3.1 broker)\n"); printf(" -P : provide a password (requires MQTT 3.1 broker)\n"); diff --git a/client/sub_client.c b/client/sub_client.c index 58855eb9..dab5cc92 100644 --- a/client/sub_client.c +++ b/client/sub_client.c @@ -127,7 +127,11 @@ void print_usage(void) printf("mosquitto_sub version %s running on libmosquitto %d.%d.%d.\n\n", VERSION, major, minor, revision); printf("Usage: mosquitto_sub [-c] [-h host] [-k keepalive] [-p port] [-q qos] [-R] -t topic ...\n"); printf(" [-1] [-T filter_out]\n"); +#ifdef WITH_SRV printf(" [-A bind_address] [-S]\n"); +#else + printf(" [-A bind_address]\n"); +#endif printf(" [-i id] [-I id_prefix]\n"); printf(" [-d] [-N] [--quiet] [-v]\n"); printf(" [-u username [-P password]]\n"); @@ -154,7 +158,9 @@ void print_usage(void) printf(" -p : network port to connect to. Defaults to 1883.\n"); printf(" -q : quality of service level to use for the subscription. Defaults to 0.\n"); printf(" -R : do not print stale messages (those with retain set).\n"); +#ifdef WITH_SRV printf(" -S : use SRV lookups to determine which host to connect to.\n"); +#endif printf(" -t : mqtt topic to subscribe to. May be repeated multiple times.\n"); printf(" -u : provide a username (requires MQTT 3.1 broker)\n"); printf(" -v : print published messages verbosely.\n");