X-Git-Url: https://jfr.im/git/erebus.git/blobdiff_plain/fb20be7c5c80f13474786337d69005f3497d21c6..b670c2f4e7385c688ffb2e0d05d607a8946e12eb:/modlib.py diff --git a/modlib.py b/modlib.py index 313f033..43187f9 100644 --- a/modlib.py +++ b/modlib.py @@ -118,3 +118,19 @@ class modlib(object): checkargs.__name__ = func.__name__ return checkargs return realhook + + def help(*args, **kwargs): + """help(args, shorthelp, longhelp, more lines longhelp, cmd=...?) + Example: + help(" ", "login") + ^ Help will only be one line. Command name determined based on function name. + help(" ", "add a user", cmd=("adduser", "useradd")) + ^ Help will be listed under ADDUSER; USERADD will say "alias for adduser" + help(None, "do stuff", "This command is really complicated.") + ^ Command takes no args. Short description (in overall HELP listing) is "do stuff". + Long description (HELP ) will say " - do stuff", newline, "This command is really complicated." + """ + try: + self.mod('help').reghelp(*args, **kwargs) + except: + pass