topics on command line override those in config file

closes #92
This commit is contained in:
Jan-Piet Mens
2016-03-01 09:54:12 +01:00
parent d0e4759638
commit bdc0da02dc

View File

@@ -1405,12 +1405,18 @@ int main(int argc, char **argv)
return (-1);
}
/*
* Push list of topics into the array so that we can
* (re)subscribe in on_connect()
*/
if (argc >= 1) { /* topics on command line override config */
/*
* Push list of topics into the array so that we can
* (re)subscribe in on_connect()
*/
if (ud->topics != NULL) {
json_delete(ud->topics);
ud->topics = NULL;
}
if (ud->topics == NULL) {
ud->topics = json_mkarray();
for (i = 0; i < argc; i++) {