Bug 4240 - "hg showconfig --help" should show command help
Summary: "hg showconfig --help" should show command help
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: Mercurial (show other bugs)
Version: 3.0
Hardware: All All
: urgent bug
Assignee: Bugzilla
URL:
Keywords: easy
Depends on:
Blocks:
 
Reported: 2014-05-06 19:42 UTC by tomjb
Modified: 2014-09-04 13:48 UTC (History)
4 users (show)

See Also:
Python Version: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description tomjb 2014-05-06 19:42 UTC
In 2.9.2, "hg showconfig -h" produces this output:

    hg showconfig [-u] [NAME]...
    
    aliases: debugconfig
    
    show combined config settings from all hgrc files
    
        With no arguments, print names and values of all config items.
    
        With one argument of the form section.name, print just the value of that
        config item.
    
        With multiple arguments, print names and values of all config items with
        matching section names.
    
        With --debug, the source (filename and line number) is printed for each
        config item.
    
        Returns 0 on success.
    
    options:
    
     -u --untrusted show untrusted configuration options
    
    use "hg -v help showconfig" to show the global options

This is (as far as I know) consistent with every Mercurial command.

In 3.0, however, "hg showconfig -h" outputs the "Configuration Files" manpage!

To see the command help, I have to use "hg help -c showconfig":

    hg config [-u] [NAME]...
    
    aliases: showconfig, debugconfig
    
    show combined config settings from all hgrc files
    
        With no arguments, print names and values of all config items.
    
        With one argument of the form section.name, print just the value of that
        config item.
    
        With multiple arguments, print names and values of all config items with
        matching section names.
    
        With --edit, start an editor on the user-level config file. With --global,
        edit the system-wide config file. With --local, edit the repository-level
        config file.
    
        With --debug, the source (filename and line number) is printed for each
        config item.
    
        See "hg help config" for more information about config files.
    
        Returns 0 on success.
    
    options:
    
     -u --untrusted show untrusted configuration options
     -e --edit      edit user config
     -l --local     edit repository config
     -g --global    edit global config

It seems that "hg showconfig --help" should produce the above output, not the manpage.
Comment 1 Pierre-Yves David 2014-05-07 18:52 UTC
looks like a regression.
Comment 2 Prabhu Gnana Sundar 2014-06-24 06:09 UTC
I have sent a patch to the mailing list.
Comment 3 HG Bot 2014-07-31 15:45 UTC
Fixed by http://selenic.com/repo/hg/rev/af15de6775c7
Matt Mackall <mpm@selenic.com>
help: always show command help with -h (issue4240)

Old behavior:
              hg help x    hg x -h    hg help -e x  hg help -c x
config        topic        topic (!)  -             cmd
showconfig    cmd          topic (!)  -             cmd
rebase        cmd          cmd        ext           cmd

New behavior:
              hg help x    hg x -h    hg help -e x  hg help -c x
config        topic        cmd        -             cmd
showconfig    cmd          cmd        -             cmd
rebase        cmd          cmd        ext           cmd

(please test the fix)