mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-24 03:33:11 +01:00
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__
|
||||
doclines = method.__doc__.splitlines()
|
||||
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
Block a user