display application version
This commit is contained in:
parent
8caeab8853
commit
55a1574df5
1 changed files with 3 additions and 2 deletions
|
|
@ -149,7 +149,8 @@ def analyze_application(app, script_name):
|
||||||
cmd_re = re.compile(r'^.+ Commands:$', re.MULTILINE)
|
cmd_re = re.compile(r'^.+ Commands:$', re.MULTILINE)
|
||||||
helptext = re.sub(cmd_re, format_title, helptext)
|
helptext = re.sub(cmd_re, format_title, helptext)
|
||||||
helptext = helptext.replace("-", r"\-")
|
helptext = helptext.replace("-", r"\-")
|
||||||
header = '.TH %s 1 "%s"' % (script_name.upper(), time.strftime("%d %B %Y"))
|
header = '.TH %s 1 "%s" "%s %s"' % (script_name.upper(), time.strftime("%d %B %Y"),
|
||||||
|
script_name, app.VERSION.replace('.', '\\&.'))
|
||||||
name = ".SH NAME\n%s" % script_name
|
name = ".SH NAME\n%s" % script_name
|
||||||
footer = """.SH COPYRIGHT
|
footer = """.SH COPYRIGHT
|
||||||
%s
|
%s
|
||||||
|
|
@ -166,7 +167,7 @@ For full COPYRIGHT see COPYING file with weboob package.
|
||||||
if not '-' in application.APPNAME:
|
if not '-' in application.APPNAME:
|
||||||
footer += "\n\n.SH SEE ALSO\nHome page: http://weboob.org/%s" % application.APPNAME.capitalize()
|
footer += "\n\n.SH SEE ALSO\nHome page: http://weboob.org/%s" % application.APPNAME.capitalize()
|
||||||
|
|
||||||
mantext = "%s\n%s\n%s\n%s" % (header, name, helptext, footer)
|
mantext = u"%s\n%s\n%s\n%s" % (header, name, helptext, footer)
|
||||||
with open(os.path.join(BASE_PATH, DEST_DIR, "%s.1" % script_name), 'w+') as manfile:
|
with open(os.path.join(BASE_PATH, DEST_DIR, "%s.1" % script_name), 'w+') as manfile:
|
||||||
for line in mantext.split('\n'):
|
for line in mantext.split('\n'):
|
||||||
manfile.write('%s\n' % line.lstrip().encode('utf-8'))
|
manfile.write('%s\n' % line.lstrip().encode('utf-8'))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue