X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=main.cpp;h=ce7db5fadcc2a18a05d567a0ac284cfe7065595f;hp=9c27f7b745d8e81b083025beb3a8bf7b6e364a44;hb=22fc985bc6b8a745232179bb9e6aa5538a679aa7;hpb=156f06e95f10587063b97b6b453a603751a0007c diff --git a/main.cpp b/main.cpp index 9c27f7b7..ce7db5fa 100644 --- a/main.cpp +++ b/main.cpp @@ -58,7 +58,7 @@ void usage() { fprintf(stdout, "Usage:\n" - " %s [OPTION…] — %s\n" + " %s [OPTIONS] [FILE]\n" "\n" "Help Options:\n" " -h, -?, --help Show help option\n" @@ -69,7 +69,7 @@ void usage() " -i, --input-file Load input from file\n" " -I, --input-format Input format\n" " -c, --clean Don't restore previous sessions on startup\n" - "\n", PV_BIN_NAME, PV_DESCRIPTION); + "\n", PV_BIN_NAME); } int main(int argc, char *argv[]) @@ -177,10 +177,17 @@ int main(int argc, char *argv[]) pv::DeviceManager device_manager(context); // Initialise the main window - pv::MainWindow w(device_manager, open_file, open_file_format, - restore_sessions); + pv::MainWindow w(device_manager); w.show(); + if (restore_sessions) + w.restore_sessions(); + + if (!open_file.empty()) + w.add_session_with_file(open_file, open_file_format); + else + w.add_default_session(); + #ifdef ENABLE_SIGNALS if (SignalHandler::prepare_signals()) { SignalHandler *const handler =