X-Git-Url: https://jfr.im/git/erebus.git/blobdiff_plain/3a8b7b5ff7664f50a2dfdedf841cf62f6c98b654..0956623592806f24abdcdf0c937e1dbdc31a38ac:/modlib.py diff --git a/modlib.py b/modlib.py index 313f033..63d9678 100644 --- a/modlib.py +++ b/modlib.py @@ -118,3 +118,19 @@ class modlib(object): checkargs.__name__ = func.__name__ return checkargs return realhook + + def help(self, *args, **kwargs): + """help(syntax, 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