X-Git-Url: https://the.earth.li/gitweb/?p=mqtt-arp.git;a=blobdiff_plain;f=mqtt-arp.c;fp=mqtt-arp.c;h=114e0efff80889fc96e5d0fd406301893f00be38;hp=2badfac8eda176fb95ff2a978163101a5f1655a2;hb=35f4b6d147a8ab61fadc8a72118c18bd930e9160;hpb=94ab2e9b79f7327fcbccde503b0699217634bf2c diff --git a/mqtt-arp.c b/mqtt-arp.c index 2badfac..114e0ef 100644 --- a/mqtt-arp.c +++ b/mqtt-arp.c @@ -280,8 +280,10 @@ struct option long_options[] = { { "host", required_argument, 0, 'h' }, { "location", required_argument, 0, 'l' }, { "mac", required_argument, 0, 'm' }, + { "password", required_argument, 0, 'P' }, { "port", required_argument, 0, 'p' }, { "topic", required_argument, 0, 't' }, + { "username", required_argument, 0, 'u' }, { "verbose", no_argument, 0, 'v' }, { 0, 0, 0, 0 } }; @@ -299,7 +301,7 @@ int main(int argc, char *argv[]) config.mqtt_port = MQTT_PORT; while (1) { - c = getopt_long(argc, argv, "c:h:l:m:p:t:v", + c = getopt_long(argc, argv, "c:h:l:m:p:P:t:u:v", long_options, &option_index); if (c == -1) @@ -335,9 +337,15 @@ int main(int argc, char *argv[]) case 'p': config.mqtt_port = atoi(optarg); break; + case 'P': + config.mqtt_password = optarg; + break; case 't': config.mqtt_topic = optarg; break; + case 'u': + config.mqtt_username = optarg; + break; case 'v': debug = true; break;