Mercurial > hg
diff tests/test-help.t @ 41009:fcc0a7ac9ebd
help: show "[no-]" only for default-on Flags
As Anton (av6) pointed out, the "[no-]" is confusing for action flags
like `hg bookmark --delete`. We could come up with a way of indicating
which flags are action flags (e.g. use None for the default value
instead of False). However, it's probably also unlikely that users
will want to negate even non-action flags like --hidden.
One of the more common flags where the "[no-]" prefix would be useful
is `hg evolve --update`. The reason it's helpful there is that it
defaults to on. So I think we can simply include "[no-]" only for
flags that are on by default (and thus require the user to add the
"[no-]" for the option to have any effect).
Note that there are use cases for negating flags that already off by
default. For example, you may have an alias for `hg log -G --hidden -T
foo` and now want to pass "--no-hidden" to that alias. However, I
think that users who want that are likely to be advanced enough that
they've already learnt about the "no-" prefix by seeing it somewhere
else.
Differential Revision: https://phab.mercurial-scm.org/D5454
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Wed, 19 Dec 2018 09:20:32 -0800 |
parents | f6187e60f792 |
children | e8e2a7656e83 |
line wrap: on
line diff
--- a/tests/test-help.t Wed Dec 05 15:37:03 2018 -0800 +++ b/tests/test-help.t Wed Dec 19 09:20:32 2018 -0800 @@ -440,7 +440,7 @@ --profile print command execution profile --version output version information and exit -h --help display help and exit - --[no-]hidden consider hidden changesets (default: off) + --hidden consider hidden changesets (default: off) --pager TYPE when to paginate (boolean, always, auto, or never) (default: auto) @@ -540,7 +540,7 @@ --profile print command execution profile --version output version information and exit -h --help display help and exit - --[no-]hidden consider hidden changesets (default: off) + --hidden consider hidden changesets (default: off) --pager TYPE when to paginate (boolean, always, auto, or never) (default: auto) @@ -905,7 +905,7 @@ xxxxxxxxxxxxxxxxxxxxxxx (default: 3) -n -- normal desc --newline VALUE line1 line2 - --[no-]default-off enable X (default: off) + --default-off enable X (default: off) --[no-]default-on enable Y (default: on) --callableopt VALUE adds foo --customopt VALUE adds bar @@ -2889,7 +2889,7 @@ <td>--help</td> <td>display help and exit</td></tr> <tr><td></td> - <td>--[no-]hidden</td> + <td>--hidden</td> <td>consider hidden changesets (default: off)</td></tr> <tr><td></td> <td>--pager TYPE</td> @@ -3093,7 +3093,7 @@ <td>--help</td> <td>display help and exit</td></tr> <tr><td></td> - <td>--[no-]hidden</td> + <td>--hidden</td> <td>consider hidden changesets (default: off)</td></tr> <tr><td></td> <td>--pager TYPE</td>