subcommands with nested help categories

[email protected] (Christopher A. Craig)
Newsgroups gmane.comp.games.mud.client.lyntin
Message-ID <[email protected]>
The following patch prepends the category listed a help text to the
one given, rather than replacing it.  This would allow commands nested
somewhere in the help heirarchy to have subcommands (in this case I
wanted a command #statusline.trans to be listed in help at
tinyui.statusline.trans).  

This patch could create problems if users put category directives in
their help texts and then expect the category given to add_help() to
override them.  I'm not sure how much that occurs.


-- 
Christopher A. Craig <[email protected]>
help.diff (application/octet-stream, 686 B)
Index: lyntin/helpmanager.py
===================================================================
RCS file: /cvsroot/lyntin/lyntin40/lyntin/helpmanager.py,v
retrieving revision 1.5
diff -u -r1.5 helpmanager.py
--- lyntin/helpmanager.py	27 Jan 2004 16:33:19 -0000	1.5
+++ lyntin/helpmanager.py	10 Apr 2004 03:37:55 -0000
@@ -81,8 +81,8 @@
 
     directives, helptext = _parse_directives(helptext)
 
-    if not categorylist and directives.has_key("category"):
-      categorylist = directives["category"].split(".")
+    if directives.has_key("category"):
+      categorylist = directives["category"].split(".") + categorylist
 
     place = self._help_tree
     for mem in categorylist:
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.