summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2015-12-27 09:13:13 +0100
committerDavid Tardon <dtardon@redhat.com>2015-12-27 09:30:50 +0100
commitc4f7fe74a12068ea3cbde8e5ea82b07e3cd3c8e3 (patch)
tree7f8040844e15ac129fb712e971f0da8615e00c6c
parent46377333551996128b0b1b4a4d25eedbc35eee31 (diff)
make --help output more help2man-friendly
Change-Id: Ibf1c4f868398b8e1c16ba0038f853d510c4dff21
-rw-r--r--src/conv/raw/vsd2raw.cpp30
-rw-r--r--src/conv/raw/vss2raw.cpp30
-rw-r--r--src/conv/svg/vsd2xhtml.cpp27
-rw-r--r--src/conv/svg/vss2xhtml.cpp27
-rw-r--r--src/conv/text/vsd2text.cpp27
-rw-r--r--src/conv/text/vss2text.cpp27
6 files changed, 150 insertions, 18 deletions
diff --git a/src/conv/raw/vsd2raw.cpp b/src/conv/raw/vsd2raw.cpp
index 518c84a..b9ffde9 100644
--- a/src/conv/raw/vsd2raw.cpp
+++ b/src/conv/raw/vsd2raw.cpp
@@ -7,6 +7,10 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <stdio.h>
#include <string.h>
#include <librevenge-stream/librevenge-stream.h>
@@ -14,19 +18,37 @@
#include <librevenge/librevenge.h>
#include <libvisio/libvisio.h>
+#ifndef PACKAGE
+#define PACKAGE "libvisio"
+#endif
+#ifndef VERSION
+#define VERSION "UNKNOWN VERSION"
+#endif
+
namespace
{
int printUsage()
{
- printf("Usage: vsd2raw [OPTION] <Visio Document File>\n");
+ printf("`vsd2raw' is used to test import of Microsoft Visio documents in " PACKAGE ".\n");
+ printf("\n");
+ printf("Usage: vsd2raw [OPTION] INPUT\n");
printf("\n");
printf("Options:\n");
- printf("--callgraph Display the call graph nesting level\n");
- printf("--help Shows this help message\n");
+ printf("\t--callgraph display the call graph nesting level\n");
+ printf("\t--help show this help message\n");
+ printf("\t--version show version information\n");
+ printf("\n");
+ printf("Report bugs to <https://bugs.documentfoundation.org/>.\n");
return -1;
}
+int printVersion()
+{
+ printf("vsd2raw " VERSION "\n");
+ return 0;
+}
+
} // anonymous namespace
int main(int argc, char *argv[])
@@ -41,6 +63,8 @@ int main(int argc, char *argv[])
{
if (!strcmp(argv[i], "--callgraph"))
printIndentLevel = true;
+ else if (!strcmp(argv[i], "--version"))
+ return printVersion();
else if (!file && strncmp(argv[i], "--", 2))
file = argv[i];
else
diff --git a/src/conv/raw/vss2raw.cpp b/src/conv/raw/vss2raw.cpp
index 0555579..4af8e3c 100644
--- a/src/conv/raw/vss2raw.cpp
+++ b/src/conv/raw/vss2raw.cpp
@@ -7,6 +7,10 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <stdio.h>
#include <string.h>
#include <librevenge-stream/librevenge-stream.h>
@@ -14,19 +18,37 @@
#include <librevenge/librevenge.h>
#include <libvisio/libvisio.h>
+#ifndef PACKAGE
+#define PACKAGE "libvisio"
+#endif
+#ifndef VERSION
+#define VERSION "UNKNOWN VERSION"
+#endif
+
namespace
{
int printUsage()
{
- printf("Usage: vsd2raw [OPTION] <Visio Stencils File>\n");
+ printf("`vss2raw' is used to test import of Microsoft Visio stencils in " PACKAGE ".\n");
+ printf("\n");
+ printf("Usage: vss2raw [OPTION] INPUT\n");
printf("\n");
printf("Options:\n");
- printf("--callgraph Display the call graph nesting level\n");
- printf("--help Shows this help message\n");
+ printf("\t--callgraph display the call graph nesting level\n");
+ printf("\t--help show this help message\n");
+ printf("\t--version show version information\n");
+ printf("\n");
+ printf("Report bugs to <https://bugs.documentfoundation.org/>.\n");
return -1;
}
+int printVersion()
+{
+ printf("vss2raw " VERSION "\n");
+ return 0;
+}
+
} // anonymous namespace
int main(int argc, char *argv[])
@@ -41,6 +63,8 @@ int main(int argc, char *argv[])
{
if (!strcmp(argv[i], "--callgraph"))
printIndentLevel = true;
+ else if (!strcmp(argv[i], "--version"))
+ return printVersion();
else if (!file && strncmp(argv[i], "--", 2))
file = argv[i];
else
diff --git a/src/conv/svg/vsd2xhtml.cpp b/src/conv/svg/vsd2xhtml.cpp
index 8bab9e7..cc91c85 100644
--- a/src/conv/svg/vsd2xhtml.cpp
+++ b/src/conv/svg/vsd2xhtml.cpp
@@ -7,6 +7,10 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <iostream>
#include <sstream>
#include <stdio.h>
@@ -16,18 +20,33 @@
#include <librevenge/librevenge.h>
#include <libvisio/libvisio.h>
+#ifndef VERSION
+#define VERSION "UNKNOWN VERSION"
+#endif
+
namespace
{
int printUsage()
{
- printf("Usage: vsd2xhtml [OPTION] <Visio Document>\n");
+ printf("`vsd2xhtml' converts Microsoft Visio documents to SVG.\n");
+ printf("\n");
+ printf("Usage: vsd2xhtml [OPTION] INPUT\n");
printf("\n");
printf("Options:\n");
- printf("--help Shows this help message\n");
+ printf("\t--help show this help message\n");
+ printf("\t--version show version information\n");
+ printf("\n");
+ printf("Report bugs to <https://bugs.documentfoundation.org/>.\n");
return -1;
}
+int printVersion()
+{
+ printf("vsd2xhtml " VERSION "\n");
+ return 0;
+}
+
} // anonymous namespace
int main(int argc, char *argv[])
@@ -39,7 +58,9 @@ int main(int argc, char *argv[])
for (int i = 1; i < argc; i++)
{
- if (!file && strncmp(argv[i], "--", 2))
+ if (!strcmp(argv[i], "--version"))
+ return printVersion();
+ else if (!file && strncmp(argv[i], "--", 2))
file = argv[i];
else
return printUsage();
diff --git a/src/conv/svg/vss2xhtml.cpp b/src/conv/svg/vss2xhtml.cpp
index 84693cd..f466988 100644
--- a/src/conv/svg/vss2xhtml.cpp
+++ b/src/conv/svg/vss2xhtml.cpp
@@ -7,6 +7,10 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <iostream>
#include <sstream>
#include <stdio.h>
@@ -16,18 +20,33 @@
#include <librevenge/librevenge.h>
#include <libvisio/libvisio.h>
+#ifndef VERSION
+#define VERSION "UNKNOWN VERSION"
+#endif
+
namespace
{
int printUsage()
{
- printf("Usage: vss2xhtml [OPTION] <Visio Stencils File>\n");
+ printf("`vss2xhtml' converts Microsoft Visio stencils to SVG.\n");
+ printf("\n");
+ printf("Usage: vss2xhtml [OPTION] INPUT\n");
printf("\n");
printf("Options:\n");
- printf("--help Shows this help message\n");
+ printf("\t--help show this help message\n");
+ printf("\t--version show version information\n");
+ printf("\n");
+ printf("Report bugs to <https://bugs.documentfoundation.org/>.\n");
return -1;
}
+int printVersion()
+{
+ printf("vss2xhtml " VERSION "\n");
+ return 0;
+}
+
} // anonymous namespace
int main(int argc, char *argv[])
@@ -39,7 +58,9 @@ int main(int argc, char *argv[])
for (int i = 1; i < argc; i++)
{
- if (!file && strncmp(argv[i], "--", 2))
+ if (!strcmp(argv[i], "--version"))
+ return printVersion();
+ else if (!file && strncmp(argv[i], "--", 2))
file = argv[i];
else
return printUsage();
diff --git a/src/conv/text/vsd2text.cpp b/src/conv/text/vsd2text.cpp
index 59b7580..e5fe090 100644
--- a/src/conv/text/vsd2text.cpp
+++ b/src/conv/text/vsd2text.cpp
@@ -7,6 +7,10 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <stdio.h>
#include <string.h>
@@ -15,18 +19,33 @@
#include <librevenge/librevenge.h>
#include <libvisio/libvisio.h>
+#ifndef VERSION
+#define VERSION "UNKNOWN VERSION"
+#endif
+
namespace
{
int printUsage()
{
- printf("Usage: vsd2text [OPTION] <Visio Document File>\n");
+ printf("`vsd2text' converts Microsoft Visio documents to plain text.\n");
+ printf("\n");
+ printf("Usage: vsd2text [OPTION] INPUT\n");
printf("\n");
printf("Options:\n");
- printf("--help Shows this help message\n");
+ printf("\t--help show this help message\n");
+ printf("\t--version show version information\n");
+ printf("\n");
+ printf("Report bugs to <https://bugs.documentfoundation.org/>.\n");
return -1;
}
+int printVersion()
+{
+ printf("vsd2text " VERSION "\n");
+ return 0;
+}
+
} // anonymous namespace
int main(int argc, char *argv[])
@@ -38,7 +57,9 @@ int main(int argc, char *argv[])
for (int i = 1; i < argc; i++)
{
- if (!file && strncmp(argv[i], "--", 2))
+ if (!strcmp(argv[i], "--version"))
+ return printVersion();
+ else if (!file && strncmp(argv[i], "--", 2))
file = argv[i];
else
return printUsage();
diff --git a/src/conv/text/vss2text.cpp b/src/conv/text/vss2text.cpp
index 76c921d..dd8148e 100644
--- a/src/conv/text/vss2text.cpp
+++ b/src/conv/text/vss2text.cpp
@@ -7,6 +7,10 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <stdio.h>
#include <string.h>
@@ -15,18 +19,33 @@
#include <librevenge/librevenge.h>
#include <libvisio/libvisio.h>
+#ifndef VERSION
+#define VERSION "UNKNOWN VERSION"
+#endif
+
namespace
{
int printUsage()
{
- printf("Usage: vss2text [OPTION] <Visio Stencils File>\n");
+ printf("`vss2text' converts Microsoft Visio stencils to plain text.\n");
+ printf("\n");
+ printf("Usage: vss2text [OPTION] INPUT\n");
printf("\n");
printf("Options:\n");
- printf("--help Shows this help message\n");
+ printf("\t--help show this help message\n");
+ printf("\t--version show version information\n");
+ printf("\n");
+ printf("Report bugs to <https://bugs.documentfoundation.org/>.\n");
return -1;
}
+int printVersion()
+{
+ printf("vss2text " VERSION "\n");
+ return 0;
+}
+
} // anonymous namespace
int main(int argc, char *argv[])
@@ -38,7 +57,9 @@ int main(int argc, char *argv[])
for (int i = 1; i < argc; i++)
{
- if (!file && strncmp(argv[i], "--", 2))
+ if (!strcmp(argv[i], "--version"))
+ return printVersion();
+ else if (!file && strncmp(argv[i], "--", 2))
file = argv[i];
else
return printUsage();