From a8269a5749a45febc3447c404103e4d5826c4677 Mon Sep 17 00:00:00 2001 From: pajlada Date: Sat, 23 Nov 2024 14:20:44 +0100 Subject: [PATCH] fix: output --version to stdout (#5727) --- CHANGELOG.md | 1 + src/main.cpp | 21 +++++++++++++-------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7428d23d..5fea06b0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -128,6 +128,7 @@ - Dev: Decoupled reply parsing from `MessageBuilder`. (#5660, #5668) - Dev: Refactored IRC message building. (#5663) - Dev: Fixed some compiler warnings. (#5672) +- Dev: Explicitly print output from `--version` to `stdout`. (#5727) - Dev: Unified parsing of historic and live IRC messages. (#5678) - Dev: 7TV's `entitlement.reset` is now explicitly ignored. (#5685) - Dev: Qt 6.8 and later now default to the GDI fontengine. (#5710) diff --git a/src/main.cpp b/src/main.cpp index 4ece0deb..2b7fc924 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -44,13 +44,16 @@ int main(int argc, char **argv) QMessageBox box; if (Modes::instance().isPortable) { - box.setText( + auto errorMessage = error.what() + QStringLiteral( "\n\nInfo: Portable mode requires the application to " "be in a writeable location. If you don't want " "portable mode reinstall the application. " - "https://chatterino.com.")); + "https://chatterino.com."); + std::cerr << errorMessage.toLocal8Bit().constData() << '\n'; + std::cerr.flush(); + box.setText(errorMessage); } else { @@ -77,12 +80,14 @@ int main(int argc, char **argv) attachToConsole(); auto version = Version::instance(); - qInfo().noquote() << QString("%1 (commit %2%3)") - .arg(version.fullVersion()) - .arg(version.commitHash()) - .arg(Modes::instance().isNightly - ? ", " + version.dateOfBuild() - : ""); + auto versionMessage = + QString("%1 (commit %2%3)") + .arg(version.fullVersion()) + .arg(version.commitHash()) + .arg(Modes::instance().isNightly ? ", " + version.dateOfBuild() + : ""); + std::cout << versionMessage.toLocal8Bit().constData() << '\n'; + std::cout.flush(); } else {