Commit 36a4b78e authored by Laurent Bachelier's avatar Laurent Bachelier 🐧

make_man: Tell that it was generated automatically

So people don't waste time altering them, but alter the source instead.
parent b9c61766
......@@ -160,6 +160,7 @@ def analyze_application(app, script_name):
helptext = re.sub(cmd_re, format_title, helptext)
helptext = helptext.replace("-", r"\-")
coding = r'.\" -*- coding: utf-8 -*-'
comment = r'.\" This file was generated automatically by tools/make_man.sh.'
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 \- %s" % (script_name, application.SHORT_DESCRIPTION)
......@@ -222,7 +223,7 @@ For full COPYRIGHT see COPYING file with weboob package.
# Skip internal applications.
footer += "\n\n.SH SEE ALSO\nHome page: http://weboob.org/applications/%s" % application.APPNAME
mantext = u"%s\n%s\n%s\n%s\n%s\n%s" % (coding, header, name, helptext, condition, footer)
mantext = u"%s\n%s\n%s\n%s\n%s\n%s\n%s" % (coding, comment, header, name, helptext, condition, footer)
with open(os.path.join(BASE_PATH, DEST_DIR, "%s.1" % script_name), 'w+') as manfile:
for line in mantext.split('\n'):
manfile.write('%s\n' % line.lstrip().encode('utf-8'))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment