" -i, --input-file Load input from file\n"
" -I, --input-format Input format\n"
" -c, --clean Don't restore previous sessions on startup\n"
+ " -s, --log-to-stdout Don't use logging, output to stdout instead\n"
"\n", PV_BIN_NAME);
}
string open_file, open_file_format, driver;
bool restore_sessions = true;
bool do_scan = true;
+ bool do_logging = true;
Application a(argc, argv);
{"input-file", required_argument, nullptr, 'i'},
{"input-format", required_argument, nullptr, 'I'},
{"clean", no_argument, nullptr, 'c'},
+ {"log-to-stdout", no_argument, nullptr, 's'},
{nullptr, 0, nullptr, 0}
};
const int c = getopt_long(argc, argv,
- "l:Vhc?d:Di:I:", long_options, nullptr);
+ "h?VDcsl:d:i:I:", long_options, nullptr);
if (c == -1)
break;
case 'c':
restore_sessions = false;
break;
+
+ case 's':
+ do_logging = false;
+ break;
}
}
pv::GlobalSettings settings;
settings.set_defaults_where_needed();
- pv::logging.init();
+ if (do_logging)
+ pv::logging.init();
// Initialise libsigrok
context = sigrok::Context::create();