Commit be2d0558 authored by Alessio Netti's avatar Alessio Netti

Help option now also displays default configuration values

parent 1a754858
......@@ -146,27 +146,31 @@ void printSyntax()
1 2 3 4 5 6 7 8
012345678901234567890123456789012345678901234567890123456789012345678901234567890
*/
_configuration = new Configuration("");
global_t& globalSettings = _configuration->getGlobal();
cout << "Usage:" << endl;
cout << " dcdbpusher [-d] [-x] [-a<string>] [-b<host>] [-p<port>] [-m<string>] [-t<number>] <path/to/configfiles/>" << endl;
cout << " dcdbpusher -h" << endl;
cout << endl;
cout << "Options:" << endl;
cout << " -a <string> Enable sensor name auto-publish using the specified string as pattern" << endl;
cout << " -b <host> MQTT broker" << endl;
cout << " -p <port> MQTT broker port" << endl;
cout << " -m <string> MQTT topic prefix" << endl;
cout << " -t <number> Thread count" << endl;
cout << " -w <path> Writable directory for temporal files" << endl;
cout << " -c <sec> Caching interval of the sensors in [s]" << endl;
cout << " -v <level> Set verbosity of output." << endl
<< " Can be a number between 5 (all output) and 0 (only fatal messages)." << endl
<< " Default level is 3 (info)" << endl;
cout << " -a <string> Auto-publish pattern [default: none]" << endl;
cout << " -b <host> MQTT broker [default: none]" << endl;
cout << " -p <port> MQTT broker port [default: " << globalSettings.brokerPort << "]" << endl;
cout << " -m <string> MQTT topic prefix [default: none]" << endl;
cout << " -t <number> Thread count [default: " << globalSettings.threads << "]" << endl;
cout << " -w <path> Writable temp dir [default: .]" << endl;
cout << " -c <sec> Cache interval in [s] [default: " << globalSettings.pluginSettings.cacheInterval / 1000 << "]" << endl;
cout << " -v <level> Set verbosity of output [default: " << globalSettings.logLevelCmd << "]" << endl
<< " Can be a number between 5 (all) and 0 (fatal)." << endl;
cout << endl;
cout << " -d Daemonize" << endl;
cout << " -x Parse and print the config but do not actually start dcdbpusher" << endl;
cout << " -h This help page" << endl;
cout << endl;
delete _configuration;
_configuration = nullptr;
}
int main(int argc, char** argv) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment