Repository :
http://git.fedorahosted.org/cgit/cura-tools.git
On branch : master
---------------------------------------------------------------
commit 8f934b4fde159c65c7ce04775efb2e0a79dbaa12
Author: Peter Hatina <phatina(a)redhat.com>
Date: Tue Aug 6 13:46:15 2013 +0200
man page generator, autogenerate date and LMIShell version
---------------------------------------------------------------
util/man-page-generator/generate-man-page | 15 +++++++++++++--
1 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/util/man-page-generator/generate-man-page
b/util/man-page-generator/generate-man-page
index 3a32b00..0d98dcd 100755
--- a/util/man-page-generator/generate-man-page
+++ b/util/man-page-generator/generate-man-page
@@ -25,12 +25,23 @@ the provided file as a first command line argument will be used.
import re
import sys
import urllib
+import datetime
try:
import html2text
except ImportError, e:
sys.exit(e.message)
sys.exit(1)
+# Try to import LMIShell from relative path
+sys.path.append("../../cli")
+try:
+ from lmi.shell import __version__ as lmishell_version
+except ImportError:
+ # LMIShell can not be imported, we need to adjust the version by hand later...
+ lmishell_version = "Unknown"
+ sys.stderr.write("Error: Can not import lmi.shell from relative path
../../cli\n")
+ sys.stderr.write(" Version used: Unknown\n")
+
# Tuple of urls, where the documentation of LMIShell lives.
wiki_pages = (
"https://fedorahosted.org/openlmi/wiki/shell/startup",
@@ -53,7 +64,7 @@ page_end_line = 17
# The man page static header with LMIShell Synopsis, Description
# and command line options.
man_page_header = \
-""".TH lmishell "1" "July 2013" "openlmi-tools
version 0.5" "User Commands"
+""".TH lmishell "1" "%s" "openlmi-tools v%s"
"User Commands"
.SH NAME
lmishell \\- (non)interactive WBEM client and interpreter.
.SH SYNOPSIS
@@ -90,7 +101,7 @@ Do not print any log messages to stderr.
.P
By default, LMIShell prints out log messages with Error severity. Options
\\fB\\-v\\fR, \\fB\\-m\\fR and \\fB\\-q\\fR are mutually exclusive and
-can not be used together."""
+can not be used together.""" % (datetime.datetime.now().strftime("%B
%Y"), lmishell_version)
# The man page static footer containing Authors section.
man_page_footer = \
""".SH "AUTHORS"