[PATCH] verbose help (show plugin providing a cmd and hidden cmds)
Robert Widhopf-Fenk
hack at robf.de
Fri Jun 9 22:39:59 BST 2006
On Friday, June 9, 2006 at 06:12:03, Robert Widhopf-Fenk wrote:
[...]
> > So I think it shouldn't require -v to see which plugin a command
> > comes from, that should be the default behaviour IMHO.
>
> If other vote for this I will strip down the patch to only
> listing the plugin name, but without adding new options.
Here is the simple one.
Robert
-------------- next part --------------
=== modified file 'bzrlib/help.py'
--- bzrlib/help.py 2006-05-10 17:48:25 +0000
+++ bzrlib/help.py 2006-06-09 21:37:40 +0000
@@ -95,6 +95,10 @@
cmd_object = get_cmd_object(cmdname)
+ if cmd_object.__module__.split(".")[1] == "plugins":
+ plugin_name = cmd_object.__module__.split(".")[2]
+ print >>outfile, '(from plugin "' + plugin_name + '")\n'
+
doc = cmd_object.help()
if doc == None:
raise NotImplementedError("sorry, no detailed help yet for %r" % cmdname)
@@ -156,6 +160,10 @@
if cmd_object.hidden:
continue
print >>outfile, command_usage(cmd_object)
+ if cmd_object.__module__.split(".")[1] == "plugins":
+ plugin_name = cmd_object.__module__.split(".")[2]
+ print >>outfile, ' (from plugin "' + plugin_name + '")'
+
cmd_help = cmd_object.help()
if cmd_help:
firstline = cmd_help.split('\n', 1)[0]
More information about the bazaar
mailing list