2 #include <QCoreApplication>
3 #include <QCommandLineParser>
6 int main(
int argc,
char *argv[])
8 QCoreApplication a(argc, argv);
9 QCommandLineParser parser;
10 parser.setApplicationDescription(
"Kona IP J2K Setup");
11 parser.addHelpOption();
12 parser.addVersionOption();
13 const QCommandLineOption deviceOption(
"d",
"which device to use",
"device");
14 parser.addOption(deviceOption);
15 const QCommandLineOption boardOption(
"b",
"which device to use",
"board");
16 parser.addOption(boardOption);
17 const QCommandLineOption listOption(
"l",
"list video formats",
"");
18 parser.addOption(listOption);
20 parser.addPositionalArgument(
"InputJsonFile", QCoreApplication::translate(
"main",
"Json File to Open."));
24 if (parser.isSet(listOption))
32 if (parser.isSet(deviceOption))
34 device = parser.value(deviceOption);
37 if (parser.isSet(boardOption))
39 device = parser.value(boardOption);
41 std::string devStr = device.toUtf8().constData();
43 const QStringList args = parser.positionalArguments();
44 if ( args.size() == 1 )