[PATCH] verbose help (show plugin providing a cmd and hidden cmds)
John Arbash Meinel
john at arbash-meinel.com
Sat Jun 17 21:49:21 BST 2006
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Michael Ellerman wrote:
> On 6/17/06, John Arbash Meinel <john at arbash-meinel.com> wrote:
...
>
> I took Robert's patched and re-jiggered it a bit, plus I added a test.
> Output looks like:
>
> concordia ~/src/bzr/branches/mpe$ ./bzr help diff
> usage: bzr diff [FILE...]
> aliases: di, dif
>
> (From plugin "difftools")
>
> Show differences in working tree.
>
> concordia ~/src/bzr/branches/mpe$ ./bzr help commands
> ...
> bzr diff [FILE...]
> (From plugin "difftools")
> Show differences in working tree.
>
> Bundle attached, or it's at http://michael.ellerman.id.au/bzr/branches/mpe
>
> cheers
>
I like the output, but I have just one comment:
...
>
> +def print_command_plugin(cmd_object, outfile, format):
> + plugin_name = cmd_object.plugin_name()
> + if plugin_name is not None:
> + print >>outfile, format % ('(From plugin "%s")' % plugin_name)
> +
> +
I don't really don't like the double expansion. I would prefer to see:
if plugin_name is not None:
out_str = '(From plugin "%s")' % plugin_name
print >>outfile, format % out_str
John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFElGrQJdeBCYSNAAMRAjU4AKC5o5ihiBPrOOZrbjeGcog+viw+fwCgj7MU
9wyJEcj47izVYw2O1vwHXH0=
=D6nH
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list