summaryrefslogtreecommitdiffstats
path: root/src/ConfigParser.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2018-02-21 11:34:00 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2018-02-21 11:34:00 +0100
commit0a07b6c5cb772d09a2a50ff6a7f1ae0bfef657a0 (patch)
tree24268ff6cd05c8a81fa0061cb7670fe51cbe8d07 /src/ConfigParser.cpp
parentfcd2de2abf3fab7573f8e430ebf90822c6eb4bb9 (diff)
downloaddabmod-0a07b6c5cb772d09a2a50ff6a7f1ae0bfef657a0.tar.gz
dabmod-0a07b6c5cb772d09a2a50ff6a7f1ae0bfef657a0.tar.bz2
dabmod-0a07b6c5cb772d09a2a50ff6a7f1ae0bfef657a0.zip
Add file format to command line options
Diffstat (limited to 'src/ConfigParser.cpp')
-rw-r--r--src/ConfigParser.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/ConfigParser.cpp b/src/ConfigParser.cpp
index e0bf6dc..33e6219 100644
--- a/src/ConfigParser.cpp
+++ b/src/ConfigParser.cpp
@@ -214,7 +214,8 @@ static void parse_configfile(
}
mod_settings.useFileOutput = true;
- mod_settings.fileOutputFormat = pt.get("fileoutput.format", mod_settings.fileOutputFormat);
+ mod_settings.fileOutputFormat = pt.get("fileoutput.format",
+ mod_settings.fileOutputFormat);
}
#if defined(HAVE_OUTPUT_UHD)
else if (output_selected == "uhd") {
@@ -409,9 +410,18 @@ void parse_args(int argc, char **argv, mod_settings_t& mod_settings)
mod_settings.useFileOutput = true;
break;
case 'F':
+ if (mod_settings.useFileOutput) {
+ mod_settings.fileOutputFormat = optarg;
+ }
#if defined(HAVE_OUTPUT_UHD)
- mod_settings.sdr_device_config.frequency = strtof(optarg, NULL);
+ else if (mod_settings.useUHDOutput) {
+ mod_settings.sdr_device_config.frequency = strtof(optarg, NULL);
+ }
#endif
+ else {
+ fprintf(stderr, "Cannot use -F before setting output!\n");
+ throw std::invalid_argument("Invalid command line options");
+ }
break;
case 'g':
mod_settings.gainMode = parse_gainmode(optarg);