diff --git a/client/doc/generate b/client/doc/generate index 967d45f31..f08e72590 100755 --- a/client/doc/generate +++ b/client/doc/generate @@ -94,7 +94,7 @@ OPTIONS AUTHORS ------- -Fabio Erculiani (lxnay@sabayon.org) +%(authors)s REPORTING BUGS -------------- @@ -136,6 +136,10 @@ for descriptor in descriptors: man['seealso'] = "" else: man['seealso'] = ", " + man['seealso'] + + if not man['authors']: + man['authors'] = "Fabio Erculiani " + man_txt = SPLIT_MAN % man split_mans.append((man['name'], man_txt)) diff --git a/client/solo/commands/command.py b/client/solo/commands/command.py index 6ae6535b5..fd391ccf7 100644 --- a/client/solo/commands/command.py +++ b/client/solo/commands/command.py @@ -10,6 +10,7 @@ """ import os +import re import sys import argparse @@ -237,6 +238,18 @@ class SoloCommand(object): stdout.write(" ".join(available_args) + "\n") stdout.flush() + def _get_authors(self): + """ + Function to pull authors of a command from module's docstring. + """ + authors = [] + module = sys.modules[self.__module__] + for x in module.__doc__.splitlines(): + m = re.match(r" *@author: *(.+)\s*$", x) + if m: + authors.append(m.group(1)) + return authors + def man(self): """ Return a dictionary containing the following man @@ -308,6 +321,7 @@ class SoloCommand(object): 'seealso': self.SEE_ALSO, 'synopsis': usage, 'options': "\n".join(options_txt), + 'authors': "\n".join(self._get_authors()) } return data