[eit] add eit-notice man page (and improve automatic man generation functions)

This commit is contained in:
Fabio Erculiani
2011-11-14 23:34:37 +01:00
parent f436f65f53
commit 6a69307f4c
6 changed files with 94 additions and 7 deletions

View File

@@ -144,7 +144,7 @@ for descriptor in descriptors:
man['name'] = "eit-" + man['name']
see_also_txt.append("%s(1)" % (man['name'],))
man['title'] = "="*(len(man['name']) + 3)
if "seealso" not in man:
if not man.get("seealso"):
man['seealso'] = ""
else:
man['seealso'] = ", " + man['seealso']

View File

@@ -72,4 +72,4 @@ lxnay@sabayon.org.
SEE ALSO
--------
eit(1),
eit(1)

View File

@@ -0,0 +1,64 @@
eit-notice(1)
=============
:man source: eit {eitversion}
:man manual: eit {eitversion}
NAME
----
eit-notice - manage repository notice-board
SYNOPSIS
--------
eit notice [-h] {add,remove,show} ...
INTRODUCTION
------------
Notice-board is the way to communicate news or other misc info to your users
through repositories. The repository notice-board is downloaded (if available)
whenever the user updates the local repositories. The Entropy Client is going to
list notice-board titles for user consumption.
OPTIONS
-------
"eit notice" supports the following options which alters its behaviour.
OPTIONAL ARGUMENTS
~~~~~~~~~~~~~~~~~~
*--help*::
show this help message and exit
ACTION
~~~~~~
*add*::
add notice-board entry
*remove*::
remove notice-board entry
*show*::
show notice-board
AUTHORS
-------
Eit has been accidentally prototyped during a rainy Sunday by Fabio
Erculiani who was looking for innovative ways of handling package
bumps in Sabayon Entropy repositories.
A few months later, Eit saw the light.
REPORTING BUGS
--------------
Report bugs to https://bugs.sabayon.org or directly to the author at
lxnay@sabayon.org.
SEE ALSO
--------
eit(1)

View File

@@ -161,5 +161,5 @@ lxnay@sabayon.org.
SEE ALSO
--------
eit-add(1), eit-branch(1), eit-commit(1), eit-repack(1)
eit-add(1), eit-branch(1), eit-commit(1), eit-notice(1), eit-repack(1)

View File

@@ -106,16 +106,26 @@ class EitCommand(object):
options_txt.append(options_header)
for group in action_groups:
options_txt.append(group.title.upper())
options_txt.append("~" * len(group.title))
if group._group_actions:
options_txt.append(group.title.upper())
options_txt.append("~" * len(group.title))
for action in group._group_actions:
action_name = action.metavar
option_strings = action.option_strings
if not option_strings:
# positional args
action_str = "*" + action_name + "*::\n"
action_str += " " + action.help + "\n"
if action_name is None:
# SubParsers
action_lst = []
for sub_action in action._get_subactions():
sub_action_str = "*" + sub_action.dest + "*::\n"
sub_action_str += " " + sub_action.help + "\n"
action_lst.append(sub_action_str)
action_str = "\n".join(action_lst)
else:
action_str = "*" + action_name + "*::\n"
action_str += " " + action.help + "\n"
else:
action_str = ""
for option_str in option_strings:

View File

@@ -68,6 +68,19 @@ class EitNotice(EitCommand):
return parser
INTRODUCTION = """\
Notice-board is the way to communicate news or other misc info to your users
through repositories. The repository notice-board is downloaded (if available)
whenever the user updates the local repositories. The Entropy Client is going to
list notice-board titles for user consumption.
"""
def man(self):
"""
Overridden from EitCommand.
"""
return self._man()
def parse(self):
parser = self._get_parser()
try: