summaryrefslogtreecommitdiff
path: root/cpp/docs
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2010-06-30 11:25:43 +0000
committerGordon Sim <gsim@apache.org>2010-06-30 11:25:43 +0000
commitbd67d8d00a4efde84e19bfbedd794b8e59d6e554 (patch)
tree0264b200fdcfd0ae79d1fe945a80bedd9ca9965a /cpp/docs
parenteded648d89a04f4c185ed97aa13d598e4886912f (diff)
downloadqpid-python-bd67d8d00a4efde84e19bfbedd794b8e59d6e554.tar.gz
Added sed based alternative to help2man to ensure that a reasonable man page is produced in all cases
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@959271 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/docs')
-rw-r--r--cpp/docs/man/Makefile.am6
-rwxr-xr-xcpp/docs/man/generate_manpage5
-rw-r--r--cpp/docs/man/groffify_options.sed7
-rw-r--r--cpp/docs/man/groffify_template.sed3
-rw-r--r--cpp/docs/man/qpidd.x15
5 files changed, 28 insertions, 8 deletions
diff --git a/cpp/docs/man/Makefile.am b/cpp/docs/man/Makefile.am
index cb13a16e4f..14295f73bf 100644
--- a/cpp/docs/man/Makefile.am
+++ b/cpp/docs/man/Makefile.am
@@ -19,7 +19,7 @@
dist_man_MANS = qpidd.1
man_aux = $(dist_man_MANS:.1=.x)
-EXTRA_DIST = $(man_aux)
+EXTRA_DIST = $(man_aux) generate_manpage groffify_options.sed groffify_template.sed
DISTCLEANFILES = $(dist_man_MANS)
CLEANFILES=qpidd.1
@@ -40,8 +40,8 @@ qpidd.1: $(srcdir)/qpidd.x $(top_builddir)/src/qpidd
@mv $@-t $@
else
qpidd.1:
- @echo "Warning: help2man not available, man page lacks options."
- @cp $(srcdir)/qpidd.x $@
+ @echo "Warning: help2man not available, using sed script instead."
+ $(srcdir)/generate_manpage $(srcdir)/qpidd.x $(top_builddir)/src/qpidd $@
endif
diff --git a/cpp/docs/man/generate_manpage b/cpp/docs/man/generate_manpage
new file mode 100755
index 0000000000..e51003852a
--- /dev/null
+++ b/cpp/docs/man/generate_manpage
@@ -0,0 +1,5 @@
+$2 --help | grep -v 'Usage: ' | sed -f $(dirname $0)/groffify_options.sed > .temp.options.groff
+cat $1 | sed -f $(dirname $0)/groffify_template.sed | sed -e '/^\.PP$/ r .temp.options.groff' -e "/^.SH NAME/ i\
+.TH QPIDD \"1\" \"$(date +'%B %Y')\" \"$($2 -v)\" \"User Commands\"
+" > $3
+rm .temp.options.groff
diff --git a/cpp/docs/man/groffify_options.sed b/cpp/docs/man/groffify_options.sed
new file mode 100644
index 0000000000..90c66d939b
--- /dev/null
+++ b/cpp/docs/man/groffify_options.sed
@@ -0,0 +1,7 @@
+s/^\( \{2\}\)\(.*)\)\( \{2,\}\)/.TP\n\2\n/
+s/^\( \{2\}\)\(.*\]\)\( \{2,\}\)/.TP\n\2\n/
+s/^\( \{2\}\)\(.*\b\)\( \{2,\}\)/.TP\n\2\n/
+s/^\([A-Z].*\):$/.SS \1/
+s/-/\\-/g
+s/^ \{2,\}//
+s/\('.*'\)/\\\&\1/
diff --git a/cpp/docs/man/groffify_template.sed b/cpp/docs/man/groffify_template.sed
new file mode 100644
index 0000000000..55367f3dce
--- /dev/null
+++ b/cpp/docs/man/groffify_template.sed
@@ -0,0 +1,3 @@
+/\[FILES\]/ i\
+.PP
+s/^\[\([A-Z ]*\)\]/.SH \1/
diff --git a/cpp/docs/man/qpidd.x b/cpp/docs/man/qpidd.x
index 9f1b465701..af5d9628ee 100644
--- a/cpp/docs/man/qpidd.x
+++ b/cpp/docs/man/qpidd.x
@@ -1,15 +1,15 @@
[NAME]
-qpidd \- the Qpid AMQP Broker Daemon
+qpidd \- the Qpid AMQP Message Broker Daemon
[SYNOPSIS]
-qpidd [options]
+qpidd [-p port] [--config config_file] [--data-dir directory]
[DESCRIPTION]
-An AMQP broker daemon that stores, routes and forwards messages using
-the Advanced Message Queueing Protocol (AMQP).
+An AMQP message broker daemon that stores, routes and forwards
+messages using the Advanced Message Queueing Protocol (AMQP).
[OPTIONS]
@@ -28,7 +28,6 @@ Each line is a name=value pair. Blank lines and lines beginning with # are ignor
# My qpidd configuration file.
port=6000
max-connections=10
- log-to-stdout=yes
log-to-file=/tmp/qpidd.log
[ENVIRONMENT]
@@ -43,4 +42,10 @@ The environment variable is the option name in uppercase, prefixed with QPID_ an
export QPID_MAX_CONNECTIONS=10
export QPID_LOG_TO_FILE=/tmp/qpidd.log
+[AUTHOR]
+The Apache Qpid Project, dev@qpid.apache.org
+
+[REPORTING BUGS]
+
+Please report bugs to users@qpid.apache.org