" -V, --version Show release version\n"
" -l, --loglevel Set libsigrok/libsigrokdecode loglevel\n"
" -d, --driver Specify the device driver to use\n"
+ " -D, --no-scan Don't auto-scan for devices, use -d spec only\n"
" -i, --input-file Load input from file\n"
" -I, --input-format Input format\n"
" -c, --clean Don't restore previous sessions on startup\n"
shared_ptr<sigrok::Context> context;
string open_file, open_file_format, driver;
bool restore_sessions = true;
+ bool do_scan = true;
Application a(argc, argv);
};
const int c = getopt_long(argc, argv,
- "l:Vhc?d:i:I:", long_options, nullptr);
+ "l:Vhc?d:Di:I:", long_options, nullptr);
if (c == -1)
break;
driver = optarg;
break;
+ case 'D':
+ do_scan = false;
+ break;
+
case 'i':
open_file = optarg;
break;
try {
// Create the device manager, initialise the drivers
- pv::DeviceManager device_manager(context, driver);
+ pv::DeviceManager device_manager(context, driver, do_scan);
// Initialise the main window
pv::MainWindow w(device_manager);
namespace pv {
-DeviceManager::DeviceManager(shared_ptr<Context> context, std::string driver) :
+DeviceManager::DeviceManager(shared_ptr<Context> context,
+ std::string driver, bool do_scan) :
context_(context)
{
unique_ptr<QProgressDialog> progress(new QProgressDialog("",
* best effort auto detection.
*/
for (auto entry : context->drivers()) {
+ if (!do_scan)
+ break;
progress->setLabelText(QObject::tr("Scanning for %1...")
.arg(QString::fromStdString(entry.first)));
class DeviceManager
{
public:
- DeviceManager(shared_ptr<sigrok::Context> context, std::string driver);
+ DeviceManager(shared_ptr<sigrok::Context> context,
+ std::string driver, bool do_scan);
~DeviceManager() = default;