More work on the new param system

This commit is contained in:
AlexandreRouma
2022-02-21 18:10:01 +01:00
parent a87aedabb8
commit 5c138aa4a5
4 changed files with 37 additions and 4 deletions

View File

@@ -37,6 +37,7 @@ namespace core {
ConfigManager configManager;
ModuleManager moduleManager;
ModuleComManager modComManager;
CommandArgsParser args;
void setInputSampleRate(double samplerate) {
// Forward this to the server
@@ -64,6 +65,16 @@ int sdrpp_main(int argc, char* argv[]) {
chdir(execPath.parent_path().string().c_str());
#endif
// Define command line options and parse arguments
core::args.defineAll();
core::args.parse(argc, argv);
// Show help and exit if requested
if ((bool)core::args["help"]) {
core::args.showHelp();
return 0;
}
// Load default options and parse command line
options::loadDefaults();
if (!options::parse(argc, argv)) { return -1; }