{ "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 }
};
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)
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;