Fix/improve 'apropos' output
authorPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Sun, 10 May 2020 18:21:51 +0000 (20:21 +0200)
committerPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Fri, 15 May 2020 20:17:45 +0000 (22:17 +0200)
commit7c05caf72d31d7382819f1113fdcf13c45729a8d
tree4baa0c3c7e840e40efa84c744ae591b3aac88de5
parent3b3aaacba15292f185b6e8ba5faba1ed89c9f908
Fix/improve 'apropos' output

Similarly to 'help CLASS', apropos possibly shows several
times the same help (for the command and for each of its aliases).

This patch changes 'apropos' so that the help for a command and
all its aliases is shown once.

So, apropos_cmd now skips all aliases/abbreviations, as these are printed
as part of the help of the aliased command.

When 'apropos' prints the help of a command, function 'help_cmd' now
unconditionally print the command name and its possible aliases (as we must
indicate to the user the command/aliases for which the help is printed).

When 'help somecommand' prints the help of a command, if the command is not
aliased, the command name is not printed (to avoid a useless first line), but if
it has aliases, then the command name and all its aliases are now printed.
In addition to provide to the user the choice of the best way to
type a command, it also avoids the strange behaviour that the output
of 'help somealias' does not mention somealias.

gdb/ChangeLog

2020-05-15  Philippe Waroquiers  <philippe.waroquiers@skynet.be>

* cli/cli-decode.c (apropos_cmd): Produce output for aliases
when their aliased command is traversed.
(help_cmd): Add fput_command_names_styled call to
output command name and aliases when command has an alias.

gdb/testsuite/ChangeLog

2020-05-15  Philippe Waroquiers  <philippe.waroquiers@skynet.be>

* gdb.base/help.exp: Test apropos and help for commands
having aliases.  Fixed comments not starting with an
upper-case letter or not finishing with a dot.
gdb/ChangeLog
gdb/cli/cli-decode.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/help.exp
This page took 0.025112 seconds and 4 git commands to generate.