Added argc check
This commit is contained in:
parent
7b7910a903
commit
95dc3b1a5e
13
src/main.cpp
13
src/main.cpp
|
@ -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();
|
||||
|
||||
|
|
Loading…
Reference in a new issue