From 7d29bc06e28a0862976bebb1a31284ee57bcdcad Mon Sep 17 00:00:00 2001 From: Simon Sobisch Date: Fri, 7 Jun 2024 18:48:23 +0000 Subject: [PATCH] feat: provide option to start with recording page --- src/main.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index 58e46ca8..7e5d96a8 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -166,6 +166,10 @@ int main(int argc, char** argv) QCoreApplication::translate("main", "Path to the objdump binary."), QStringLiteral("path")); parser.addOption(objdumpBinary); + const auto startRecordPage = + QCommandLineOption(QStringLiteral("record"), QCoreApplication::translate("main", "Start with recording page.")); + parser.addOption(startRecordPage); + parser.addPositionalArgument( QStringLiteral("files"), QCoreApplication::translate("main", "Optional input files to open on startup, i.e. perf.data files."), @@ -270,6 +274,8 @@ int main(int argc, char** argv) const auto perfDataFile = QStringLiteral("perf.data"); if (QFile::exists(perfDataFile) && window) { window->openFile(perfDataFile); + } else if (parser.isSet(startRecordPage)) { + window->onRecordButtonClicked(); } } if (window)