32int main(
int argc,
char *argv[]) {
38 QCoreApplication app(argc, argv);
40 QCommandLineParser parser;
41 parser.setApplicationDescription(
42 QStringLiteral(
"gvedit - simple graph editor and viewer"));
43 parser.addPositionalArgument(
44 QStringLiteral(
"files"),
45 QCoreApplication::translate(
"main",
"files to open."),
46 QStringLiteral(
"[files...]"));
48 const QCommandLineOption helpOption(
52 QStringLiteral(
"help"),
54 QCoreApplication::translate(
"main",
55 "Displays help on commandline options."));
56 parser.addOption(helpOption);
58 const QCommandLineOption scaleInputBy72Option(
61 QStringLiteral(
"scale-input-by-72"),
63 QCoreApplication::translate(
"main",
"Scale input by 72"));
64 parser.addOption(scaleInputBy72Option);
66 const QCommandLineOption verboseOption(
69 QStringLiteral(
"verbose"),
71 QCoreApplication::translate(
"main",
"Verbose mode"));
72 parser.addOption(verboseOption);
74 if (!parser.parse(app.arguments())) {
78 if (parser.isSet(helpOption)) {
82 if (parser.isSet(scaleInputBy72Option)) {
86 if (parser.isSet(verboseOption)) {
90 files = parser.positionalArguments();
93 QApplication app(argc, argv);
97 const int ret = app.exec();