summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2016-02-21 07:52:32 +0100
committerDavid Tardon <dtardon@redhat.com>2016-02-21 15:33:12 +0100
commit7ff74266fac998b0dbbf0aa5d6a3018c8a948ee4 (patch)
tree713a9d6de8391bf416e0fc55e3ce4c26ac3156ff
parent77310ccb280fbb68bdb85f728835efde7d4d587a (diff)
make --help output more help2man-friendly
-rw-r--r--src/conv/html/sw6022html.cpp22
-rw-r--r--src/conv/raw/sw6022raw.cpp27
-rw-r--r--src/conv/text/sw6022text.cpp24
3 files changed, 50 insertions, 23 deletions
diff --git a/src/conv/html/sw6022html.cpp b/src/conv/html/sw6022html.cpp
index 2e3202c..e1d9312 100644
--- a/src/conv/html/sw6022html.cpp
+++ b/src/conv/html/sw6022html.cpp
@@ -23,22 +23,30 @@
#define VERSION "UNKNOWN VERSION"
#endif
+#define TOOL "sw6022html"
+
namespace
{
int printUsage()
{
- printf("Usage: sw6022html [OPTION] <document>\n");
- printf("\n");
- printf("Options:\n");
- printf("--help Shows this help message\n");
- printf("--version Output sw6022html version\n");
- return -1;
+ printf(
+ "`" TOOL "' converts Software602 documents to HTML.\n"
+ "\n"
+ "Usage: " TOOL " [OPTION] INPUT\n"
+ "\n"
+ "Options:\n"
+ "\t--help show this help message\n"
+ "\t--version show version information\n"
+ "\n"
+ "Report bugs to <>.\n"
+ );
+ return 0;
}
int printVersion()
{
- printf("sw6022html %s\n", VERSION);
+ printf(TOOL " " VERSION "\n");
return 0;
}
diff --git a/src/conv/raw/sw6022raw.cpp b/src/conv/raw/sw6022raw.cpp
index 092e56b..9498e16 100644
--- a/src/conv/raw/sw6022raw.cpp
+++ b/src/conv/raw/sw6022raw.cpp
@@ -19,27 +19,38 @@
#include "config.h"
#endif
+#ifndef PACKAGE
+#define PACKAGE "libsw602"
+#endif
#ifndef VERSION
#define VERSION "UNKNOWN VERSION"
#endif
+#define TOOL "sw6022raw"
+
namespace
{
int printUsage()
{
- printf("Usage: sw6022raw [OPTION] <document>\n");
- printf("\n");
- printf("Options:\n");
- printf("--callgraph Display the call graph nesting level\n");
- printf("--help Shows this help message\n");
- printf("--version Output sw6022raw version \n");
- return -1;
+ printf(
+ "`" TOOL "' is used to test " PACKAGE ".\n"
+ "\n"
+ "Usage: " TOOL " [OPTION] INPUT\n"
+ "\n"
+ "Options:\n"
+ "\t--callgraph display the call graph nesting level\n"
+ "\t--help show this help message\n"
+ "\t--version show version information\n"
+ "\n"
+ "Report bugs to <>.\n"
+ );
+ return 0;
}
int printVersion()
{
- printf("sw6022raw %s\n", VERSION);
+ printf(TOOL " " VERSION "\n");
return 0;
}
diff --git a/src/conv/text/sw6022text.cpp b/src/conv/text/sw6022text.cpp
index abbd22a..e661be5 100644
--- a/src/conv/text/sw6022text.cpp
+++ b/src/conv/text/sw6022text.cpp
@@ -23,23 +23,31 @@
#define VERSION "UNKNOWN VERSION"
#endif
+#define TOOL "sw6022text"
+
namespace
{
int printUsage()
{
- printf("Usage: sw6022text [OPTION] <document>\n");
- printf("\n");
- printf("Options:\n");
- printf("--info Display document metadata instead of the text\n");
- printf("--help Shows this help message\n");
- printf("--version Output sw6022text version\n");
- return -1;
+ printf(
+ "`" TOOL "' converts Software602 documents to plain text.\n"
+ "\n"
+ "Usage: " TOOL " [OPTION] INPUT\n"
+ "\n"
+ "Options:\n"
+ "\t--info print document metadata instead of text\n"
+ "\t--help show this help message\n"
+ "\t--version show version information\n"
+ "\n"
+ "Report bugs to <>.\n"
+ );
+ return 0;
}
int printVersion()
{
- printf("sw6022text %s\n", VERSION);
+ printf(TOOL " " VERSION "\n");
return 0;
}