From cb70783e64d3571dd1de7dd10da6529489c0e603 Mon Sep 17 00:00:00 2001 From: ConfuSomu Date: Sat, 10 Jun 2023 19:20:20 -0400 Subject: Exit with exit codes depending on command line --- src/mainwindow.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 363dcc0..ec2026e 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -11,6 +11,7 @@ #include #include #include +#include MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) @@ -27,13 +28,13 @@ MainWindow::~MainWindow() void MainWindow::act_command_line(CommandLineParsedOptions &options, QCommandLineParser &parser) { switch (options.result) { case CommandLineError: - QMessageBox::critical(this, tr("Command line"), tr("The passed command line is incorrect and will be ignored.\nMore information: %1").arg(options.error_message)); + QMessageBox::critical(this, tr("Command line"), tr("The passed command line is incorrect and will be ignored.\nMore information: %1").arg(options.error_message)); exit(EXIT_FAILURE); break; case CommandLineHelpRequested: - QMessageBox::information(this, QGuiApplication::applicationDisplayName(), "
" + parser.helpText() + "
"); exit(0); + QMessageBox::information(this, QGuiApplication::applicationDisplayName(), "
" + parser.helpText() + "
"); exit(EXIT_SUCCESS); break; case CommandLineVersionRequested: - on_actionAbout_triggered(true); exit(0); + on_actionAbout_triggered(true); exit(EXIT_SUCCESS); break; case CommandLineOk: if (!options.outbox_filename.isEmpty()) -- cgit v1.2.3-54-g00ecf