management of help functions improved.

This commit is contained in:
François Dausseur
2025-10-28 11:37:10 +01:00
parent d46e3b9859
commit 0da36439a6

View File

@@ -175,7 +175,28 @@ class Commands(Thread):
if module == "": if module == "":
if method == 'help': if method == 'help':
return self.list_modules() # No argument was given to the help function
if len(args) == 0 and len(kwargs) == 0:
msg = "Type 'help <module>' to have the list of module's functions.\n"
msg += "Type 'help <module>.<function>' to documentation of a specific function.\n"
success, ret = self.list_modules()
return success, msg + ret
else:
# 1 argument has been provided
if len(args) > 0:
arg = args[0]
else:
arg = list(kwargs.keys())[0]
spl = arg.split(".", 1)
# help <module>
if len(spl) == 1:
module = arg
# help <module>.<method>
else:
module = spl[0]
args = [spl[1]]
kwargs = {}
else: else:
module = self.defmod module = self.defmod