diff options
author | Simon Marchi <simon.marchi@polymtl.ca> | 2021-09-22 13:43:25 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@efficios.com> | 2021-10-28 10:44:18 -0400 |
commit | f54bdb6d2799c658e076f10e42222949dc51032d (patch) | |
tree | bd9804255bf472e93740a8b47b2f90d5bde939c3 /gdb/guile/guile.c | |
parent | 5ad2694b1ebe123ea92fcee094a69bcdc9769985 (diff) | |
download | binutils-gdb-f54bdb6d2799c658e076f10e42222949dc51032d.tar.gz |
gdb: add add_setshow_prefix_cmd
There's a common pattern to call add_basic_prefix_cmd and
add_show_prefix_cmd to add matching set and show commands. Add the
add_setshow_prefix_cmd function to factor that out and use it at a few
places.
Change-Id: I6e9e90a30e9efb7b255bf839cac27b85d7069cfd
Diffstat (limited to 'gdb/guile/guile.c')
-rw-r--r-- | gdb/guile/guile.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/gdb/guile/guile.c b/gdb/guile/guile.c index 8ba840cba6a..30cfa296fc5 100644 --- a/gdb/guile/guile.c +++ b/gdb/guile/guile.c @@ -780,17 +780,17 @@ This command is only a placeholder.") ); add_com_alias ("gu", guile_cmd_element, class_obscure, 1); - cmd_list_element *set_guile_cmd - = add_basic_prefix_cmd ("guile", class_obscure, - _("Prefix command for Guile preference settings."), - &set_guile_list, 0, &setlist); - add_alias_cmd ("gu", set_guile_cmd, class_obscure, 1, &setlist); - - cmd_list_element *show_guile_cmd - = add_show_prefix_cmd ("guile", class_obscure, - _("Prefix command for Guile preference settings."), - &show_guile_list, 0, &showlist); - add_alias_cmd ("gu", show_guile_cmd, class_obscure, 1, &showlist); + set_show_commands setshow_guile_cmds + = add_setshow_prefix_cmd ("guile", class_obscure, + _("\ +Prefix command for Guile preference settings."), + _("\ +Prefix command for Guile preference settings."), + &set_guile_list, &show_guile_list, + &setlist, &showlist); + + add_alias_cmd ("gu", setshow_guile_cmds.set, class_obscure, 1, &setlist); + add_alias_cmd ("gu", setshow_guile_cmds.show, class_obscure, 1, &showlist); cmd_list_element *info_guile_cmd = add_basic_prefix_cmd ("guile", class_obscure, |