aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2014-11-17 15:42:50 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2014-11-17 15:42:50 +0100
commit6dadbaba8a37579f3f7a1c912cf48d4d0964a450 (patch)
tree9e266f79029a76e7bb4ceb4d2ff9779cd2494fe8
parentcb495ca5dd7773dc07cbc44cfa72067abd59b9dc (diff)
downloaddabmux-6dadbaba8a37579f3f7a1c912cf48d4d0964a450.tar.gz
dabmux-6dadbaba8a37579f3f7a1c912cf48d4d0964a450.tar.bz2
dabmux-6dadbaba8a37579f3f7a1c912cf48d4d0964a450.zip
Make -e optional
-rw-r--r--src/DabMux.cpp15
-rw-r--r--src/utils.cpp2
2 files changed, 15 insertions, 2 deletions
diff --git a/src/DabMux.cpp b/src/DabMux.cpp
index 08a3c15..47e92c6 100644
--- a/src/DabMux.cpp
+++ b/src/DabMux.cpp
@@ -351,7 +351,20 @@ int main(int argc, char *argv[])
bool MNSC_increment_time = false;
try {
- if (argc > 1 && strncmp(argv[1], "-e", 2) == 0) { // use external config file
+ if (argc == 1) { // Assume the only argument is a config file
+ string conf_file = argv[1];
+
+ try {
+ parse_configfile(conf_file, outputs, ensemble, &enableTist, &FICL,
+ &factumAnalyzer, &limit, &rc, &statsserverport, &edi_conf);
+ }
+ catch (runtime_error &e) {
+ etiLog.log(error, "Configuration file parsing error: %s\n",
+ e.what());
+ throw MuxInitException();
+ }
+ }
+ else if (argc > 1 && strncmp(argv[1], "-e", 2) == 0) { // use external config file
try {
if (argc != 3) {
diff --git a/src/utils.cpp b/src/utils.cpp
index 85f42d2..ee447d3 100644
--- a/src/utils.cpp
+++ b/src/utils.cpp
@@ -152,7 +152,7 @@ void printUsage(char *name, FILE* out)
fprintf(out, "\nSYNOPSYS\n");
fprintf(out, " You can use either a configuration file, or the command line arguments\n");
fprintf(out, " With external configuration file:\n");
- fprintf(out, " %s -e configuration.mux\n", name);
+ fprintf(out, " %s [-e] configuration.mux\n", name);
fprintf(out, " See doc/example.config for an example format for the configuration file\n");
fprintf(out, " With command line arguments:\n");
fprintf(out, " %s"