Allow doc to be specified for getSyntax, similar to getHelp

This commit is contained in:
James Vega 2008-12-22 02:18:56 +00:00
parent 9cc917bd36
commit c936897488

View File

@ -230,10 +230,13 @@ def getHelp(method, name=None, doc=None):
s = '(%s) -- %s' % (ircutils.bold(s), help)
return utils.str.normalizeWhitespace(s)
def getSyntax(method, name=None):
def getSyntax(method, name=None, doc=None):
if name is None:
name = method.__name__
if doc is None:
doclines = method.__doc__.splitlines()
else:
doclines = doc.splitlines()
return '%s %s' % (name, doclines[0])
class Error(Exception):