Re: [PATCH v3] help: make option --help open man pages only for Git commands

2016-08-16 Thread Junio C Hamano
Ralf Thielow writes: > 2016-08-16 19:27 GMT+02:00 Junio C Hamano : >> Ralf Thielow writes: >>> + >>> + if (swapped) >>> + return help_unknown_cmd(cmd); >> >> I am guilty of suggesting "swapped"; even if we are

Re: [PATCH v3] help: make option --help open man pages only for Git commands

2016-08-16 Thread Ralf Thielow
2016-08-16 19:27 GMT+02:00 Junio C Hamano : > Ralf Thielow writes: >> + >> + if (swapped) >> + return help_unknown_cmd(cmd); > > I am guilty of suggesting "swapped"; even if we are going to mark > this as OPT_HIDDEN, I think we should be

Re: [PATCH v3] help: make option --help open man pages only for Git commands

2016-08-16 Thread Junio C Hamano
Ralf Thielow writes: > builtin/help.c | 30 +++--- > git.c | 15 ++- > t/t0012-help.sh | 15 +++ > 3 files changed, 52 insertions(+), 8 deletions(-) > create mode 100755 t/t0012-help.sh > > diff --git

Re: [PATCH v3] help: make option --help open man pages only for Git commands

2016-08-16 Thread Ralf Thielow
2016-08-16 18:33 GMT+02:00 John Keeping : > On Tue, Aug 16, 2016 at 06:20:30PM +0200, Ralf Thielow wrote: >> static struct option builtin_help_options[] = { >> + OPT_BOOL('s', "swapped", , "mark as being called by >> --help"), > > OPT_HIDDEN_BOOL maybe? > Yeah >_<

Re: [PATCH v3] help: make option --help open man pages only for Git commands

2016-08-16 Thread John Keeping
On Tue, Aug 16, 2016 at 06:20:30PM +0200, Ralf Thielow wrote: > If option --help is passed to a Git command, we try to open > the man page of that command. However, we do it even for commands > we don't know. Make sure it is a Git command by using "help_unknown_cmd" > which is even able to

[PATCH v3] help: make option --help open man pages only for Git commands

2016-08-16 Thread Ralf Thielow
If option --help is passed to a Git command, we try to open the man page of that command. However, we do it even for commands we don't know. Make sure it is a Git command by using "help_unknown_cmd" which is even able to assume a command if the user made a typo. This breaks "git --help" while