diff options
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/main.cpp b/src/main.cpp index ae59d79..f415206 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -35,13 +35,13 @@ int main(int argc, char *argv[]) /* parse command line arguments */ QMap<QString, QString> clOpts; int longIndex = 0; - static const char *optString = "u:d:c:Dh"; + static const char *optString = "u:d:c:D:h"; static const struct option longOpts[] = { {"url", required_argument, NULL, 'u'}, {"download", required_argument, NULL, 'd'}, {"config", required_argument, NULL, 'c'}, - {"debug", no_argument, NULL, 'D'}, + {"debug", required_argument, NULL, 'D'}, {"help", no_argument, NULL, 'h'} }; int opt = getopt_long(argc, argv, optString, longOpts, &longIndex); @@ -58,7 +58,7 @@ int main(int argc, char *argv[]) case 'c': clOpts.insert("configFile", optarg); case 'D': - clOpts.insert("debug", "debug"); + clOpts.insert("debug", optarg); break; case 'h': clOpts.insert("help", "help"); @@ -70,12 +70,12 @@ int main(int argc, char *argv[]) if (clOpts.contains("help")) printHelp(); - if (clOpts.contains("debug")){ - /* init qxt logger & set debug level */ - qxtLog->enableLogLevels(QxtLogger::DebugLevel); - debug = true; - } - /* "search" config file */ + if (clOpts.contains("debug")) + debugMode = clOpts.value("debug").toInt(); + else + debugMode = -1; + + /* look for config file */ QString configFilePath; QFileInfo confInfo; if (clOpts.contains("configFile")) |
