mirror of https://github.com/Mikaela/Limnoria.git
Allow doc to be specified for getSyntax, similar to getHelp
This commit is contained in:
parent
9cc917bd36
commit
c936897488
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue