mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 21:35:11 +01:00
[pylightning] add args list to getmanifest
[ Shamelessly stolen by Rusty, tweaked parameter name ]
This commit is contained in:
parent
0c89fc5d70
commit
6e4eae372d
@ -306,9 +306,20 @@ class Plugin(object):
|
||||
doc = "Undocumented RPC method from a plugin."
|
||||
doc = re.sub('\n+', ' ', doc)
|
||||
|
||||
argspec = inspect.getargspec(func)
|
||||
args = argspec.args[1:]
|
||||
defaults = argspec.defaults
|
||||
|
||||
# Make optional args be surrounded by square brackets
|
||||
# list regular lightning-cli commands args
|
||||
if defaults:
|
||||
for idx in range(-len(defaults), 0):
|
||||
args[idx] = '[' + args[idx] + ']'
|
||||
|
||||
methods.append({
|
||||
'name': name,
|
||||
'description': doc,
|
||||
'usage': " ".join(args),
|
||||
'description': doc
|
||||
})
|
||||
|
||||
return {
|
||||
|
Loading…
Reference in New Issue
Block a user