binutils-gdb/gdb/cli
Philippe Waroquiers effcf7b144 Allow to document user-defined aliases.
Compared to the previous version, this version fixes the comments reported by
Tom Tromey and ensures that the 'help some-user-documented-alias'
shows the alias definition to ensure the user understands this is an
alias even if specifically documented.

When using 'help ALIASNAME', GDB shows the help of the aliased command.
This is a good default behaviour.

However, GDB alias command allows to define aliases with arguments
possibly changing or tuning significantly the behaviour of
the aliased command.  In such a case, showing the help of the aliased
command might not be ideal.

This is particularly true when defining an alias as a set of
nested 'with' followed by a last command to launch, such as:
  (gdb) alias pp10 = with print pretty -- with print elements 10 -- print
Asking 'help pp10' shows the help of the 'with' command, which is
not particularly useful:
  (gdb) help pp10
  with, pp10, w
    alias pp10 = with print pretty -- with print elements 10 -- print
  Temporarily set SETTING to VALUE, run COMMAND, and restore SETTING.
  Usage: with SETTING [VALUE] [-- COMMAND]
  ....

Such an alias can now be documented by the user:
  (gdb) document pp10
  >Pretty printing an expressiong, printing 10 elements.
  >Usage: pp10 [PRINT-COMMAND-OPTIONS] EXP
  >See 'help print' for more information.
  >end
  (gdb) help pp10
    alias pp10 = with print pretty -- with print elements 10 -- print
  Pretty printing an expressiong, printing 10 elements.
  Usage: pp10 [PRINT-COMMAND-OPTIONS] EXP
  See 'help print' for more information.
  (gdb)

When a user-defined alias is documented specifically, help and apropos
use the provided alias documentation instead of the documentation of
the aliased command.

Such a documented alias is also not shown anymore in the help of the
aliased command, and the alias is not listed anymore in the help
of the aliased command.  In particular for cases such as pp10 example above,
indicating that pp10 is an alias of the 'with' command is confusing.
2022-08-25 18:57:25 +02:00
..
cli-cmds.c Remove two initialization functions 2022-08-19 08:23:20 -06:00
cli-cmds.h Remove two initialization functions 2022-08-19 08:23:20 -06:00
cli-decode.c Allow to document user-defined aliases. 2022-08-25 18:57:25 +02:00
cli-decode.h gdb/cli: convert cli_suppress_notification from int to bool 2022-02-07 08:26:55 +01:00
cli-dump.c Unify gdb printf functions 2022-03-29 12:46:24 -06:00
cli-interp.c Remove manual lifetime management from cli_interp 2022-07-18 08:49:55 -06:00
cli-interp.h Don't declare cli_set_logging 2022-06-23 14:26:13 -06:00
cli-logging.c Unify gdb printf functions 2022-03-29 12:46:24 -06:00
cli-option.c Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
cli-option.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
cli-script.c Allow to document user-defined aliases. 2022-08-25 18:57:25 +02:00
cli-script.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
cli-setshow.c GDB: Remove extraneous full stops from `set' command error messages 2022-06-29 15:27:41 +01:00
cli-setshow.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
cli-style.c gdb: add support for disassembler styling using libopcodes 2022-07-11 12:02:54 +01:00
cli-style.h gdb: add support for disassembler styling using libopcodes 2022-07-11 12:02:54 +01:00
cli-utils.c Unify gdb printf functions 2022-03-29 12:46:24 -06:00
cli-utils.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00