#include "pylonrecorder.h"
#include <QApplication>
#include <QCommandLineParser>
#include <pylon/PylonIncludes.h>

int main(int argc, char *argv[])
{
    QApplication app(argc, argv);
    QGuiApplication::setApplicationDisplayName(PylonRecorder::tr("Pylon Recorder"));
    QCommandLineParser commandLineParser;
    commandLineParser.addHelpOption();
    commandLineParser.addPositionalArgument(PylonRecorder::tr("[file]"), PylonRecorder::tr("Image file to open."));
    commandLineParser.process(QCoreApplication::arguments());
    PylonRecorder recorder;
    if (!commandLineParser.positionalArguments().isEmpty()
            && !recorder.loadFile(commandLineParser.positionalArguments().front())) {
        return -1;
    }
    recorder.show();
    int ret = app.exec();
    return ret;
}