[PATCH] add -e/--extension switch to help command to display extension help text only

Adrian Buehlmann adrian at cadifra.com
Sun Dec 13 06:42:12 CST 2009


On 13.12.2009 13:00, Henri Wiechers wrote:
> # HG changeset patch
> # User Henri Wiechers <hwiechers at gmail.com>
> # Date 1259490173 -7200
> # Node ID c0c06fc4d0bff2c1b1b9a9e75ac6ea5814d2d7e6
> # Parent  dfc3ed37d58d921428a6a684001e4f708c445a52
> add -e/--extension switch to help command to display extension help text only
> 
> Some extensions (such as attic) have commands/aliases that have the same name
> as the extension itself. This means that the extension help is inaccessible
> since 'hg help <extension-name>' will display the command/alias' help instead.
> This patch remedies that by adding a switch that forces help to only display
> the help text for extensions.
> 

In case you didn't know:

You can name the extension in your hgrc as you like, e.g.

[extensions]
hgattic = /path/to/attic.py

then you get the help text for the -extension- with

<snip>
$ hg help hgattic
hgattic extension - manage uncommitted changes with a set of named patches

This extension lets you create patches from uncommited changes using its
'shelve' command. Shelved changes are unapplied from the working copy and
stored as patches in the .hg/attic directory.
...
</snip>

and the help text for the attic -command- with

<snip>
$ hg help attic
hg attic-display [-c | -d name]

aliases: attic, ls

lists the available patches in the attic

options:

 -c --current  show information about the current patch being worked on
 -d --header   show information about <given patch name>

use "hg -v help attic" to show global options
</snip>

So it is more a question of (bad?) convention how to name extensions in the hgrc


More information about the Mercurial-devel mailing list