diff 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
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/cconvert_options.h	Tue Mar 22 10:39:19 2016 +0100
@@ -0,0 +1,43 @@
+#ifndef CCONVERT_OPTIONS_H
+#define CCONVERT_OPTIONS_H
+/* Copyright (C) 2016 by ETH Zürich
+ * Software engineering by Intevation GmbH
+ *
+ * This file is Free Software under the GNU GPL (v>=2)
+ * and comes with ABSOLUTELY NO WARRANTY!
+ * See LICENSE.txt for details.
+ */
+
+/** @file Commandline options for clickerconvert */
+
+#include <QCommandLineParser>
+#include <QObject>
+
+static void cconvert_options(QCommandLineParser &parser)
+{
+    QList<QCommandLineOption> options;
+
+    options << QCommandLineOption(QStringList() << QStringLiteral("pdf")
+                                  << QStringLiteral("p"),
+                                  QObject::tr("Output as pdf (default xlsx)"))
+            << QCommandLineOption(QStringList() << QStringLiteral("output")
+                                  << QStringLiteral("o"),
+                                  QObject::tr("write output to file (default stdout)"),
+                                  QObject::tr("[file]"))
+            << QCommandLineOption(QStringList() << QStringLiteral("title")
+                                  << QStringLiteral("t"),
+                                  QObject::tr("Set the title of the document."),
+                                  QObject::tr("\"The Title\""))
+            << QCommandLineOption(QStringList() << QStringLiteral("debug"),
+                                  QObject::tr("Print debug output."));
+
+    Q_FOREACH (const QCommandLineOption &opt, options)
+        parser.addOption(opt);
+    parser.addVersionOption();
+    parser.addHelpOption();
+
+    parser.addPositionalArgument(QStringLiteral("file"),
+                                 QObject::tr("File to process (default stdin)"),
+                                 QObject::tr("[file]"));
+}
+#endif // CCONVERT_OPTIONS_H
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)