Added argc check

This commit is contained in:
Robert 2020-11-17 18:00:34 +01:00
parent 7b7910a903
commit 95dc3b1a5e

View file

@ -1,9 +1,22 @@
#include <qmessagebox.h>
#include <qapplication.h>
#include "MainWindow.hpp"
int main(int argc, char** argv)
{
QApplication app(argc, argv);
if (argc < 2)
{
QMessageBox no_args_error_box;
no_args_error_box.setWindowTitle("Error");
no_args_error_box.setText("Too few arguments. Need at least one CSV file.");
no_args_error_box.setIcon(QMessageBox::Icon::Critical);
no_args_error_box.exec();
return 1;
}
MainWindow window;
window.show();