Mercurial > clickerconvert
comparison src/cconvert_options.h @ 3:8b4c49c92451
Add initial implementation that handles choices
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Tue, 22 Mar 2016 10:39:19 +0100 |
parents | |
children | afb1ecf0f1db |
comparison
equal
deleted
inserted
replaced
2:4926d626fe15 | 3:8b4c49c92451 |
---|---|
1 #ifndef CCONVERT_OPTIONS_H | |
2 #define CCONVERT_OPTIONS_H | |
3 /* Copyright (C) 2016 by ETH Zürich | |
4 * Software engineering by Intevation GmbH | |
5 * | |
6 * This file is Free Software under the GNU GPL (v>=2) | |
7 * and comes with ABSOLUTELY NO WARRANTY! | |
8 * See LICENSE.txt for details. | |
9 */ | |
10 | |
11 /** @file Commandline options for clickerconvert */ | |
12 | |
13 #include <QCommandLineParser> | |
14 #include <QObject> | |
15 | |
16 static void cconvert_options(QCommandLineParser &parser) | |
17 { | |
18 QList<QCommandLineOption> options; | |
19 | |
20 options << QCommandLineOption(QStringList() << QStringLiteral("pdf") | |
21 << QStringLiteral("p"), | |
22 QObject::tr("Output as pdf (default xlsx)")) | |
23 << QCommandLineOption(QStringList() << QStringLiteral("output") | |
24 << QStringLiteral("o"), | |
25 QObject::tr("write output to file (default stdout)"), | |
26 QObject::tr("[file]")) | |
27 << QCommandLineOption(QStringList() << QStringLiteral("title") | |
28 << QStringLiteral("t"), | |
29 QObject::tr("Set the title of the document."), | |
30 QObject::tr("\"The Title\"")) | |
31 << QCommandLineOption(QStringList() << QStringLiteral("debug"), | |
32 QObject::tr("Print debug output.")); | |
33 | |
34 Q_FOREACH (const QCommandLineOption &opt, options) | |
35 parser.addOption(opt); | |
36 parser.addVersionOption(); | |
37 parser.addHelpOption(); | |
38 | |
39 parser.addPositionalArgument(QStringLiteral("file"), | |
40 QObject::tr("File to process (default stdin)"), | |
41 QObject::tr("[file]")); | |
42 } | |
43 #endif // CCONVERT_OPTIONS_H |