This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
[binutils-gdb] Don't show deprecated commands in help
- From: Simon Marchi <simark at sourceware dot org>
- To: gdb-cvs at sourceware dot org
- Date: 28 Apr 2016 18:13:14 -0000
- Subject: [binutils-gdb] Don't show deprecated commands in help
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=0400cf2f56c41896ecf52b88baa1d6178eb10432
commit 0400cf2f56c41896ecf52b88baa1d6178eb10432
Author: Simon Marchi <simon.marchi@ericsson.com>
Date: Thu Apr 28 14:11:38 2016 -0400
Don't show deprecated commands in help
Just like completion doesn't show deprecated commands, I think that help
should not list them, so that we don't incite users to use them.
gdb/ChangeLog:
* cli/cli-decode.c (help_cmd_list): Do not list commands that
are deprecated.
Diff:
---
gdb/ChangeLog | 5 +++++
gdb/cli/cli-decode.c | 5 ++++-
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 5cf8a5f..6d7bfb2 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2016-04-28 Simon Marchi <simon.marchi@ericsson.com>
+
+ * cli/cli-decode.c (help_cmd_list): Do not list commands that
+ are deprecated.
+
2016-04-27 Jan Kratochvil <jan.kratochvil@redhat.com>
* remote.c (remote_start_remote): Detect PACKET_vFile_setfs.support.
diff --git a/gdb/cli/cli-decode.c b/gdb/cli/cli-decode.c
index 8a8abda..0d2b137 100644
--- a/gdb/cli/cli-decode.c
+++ b/gdb/cli/cli-decode.c
@@ -1194,13 +1194,16 @@ help_cmd_list (struct cmd_list_element *list, enum command_class theclass,
for (c = list; c; c = c->next)
{
if (c->abbrev_flag == 0
+ && !c->cmd_deprecated
&& (theclass == all_commands
|| (theclass == all_classes && c->func == NULL)
|| (theclass == c->theclass && c->func != NULL)))
{
print_help_for_command (c, prefix, recurse, stream);
}
- else if (c->abbrev_flag == 0 && recurse
+ else if (c->abbrev_flag == 0
+ && recurse
+ && !c->cmd_deprecated
&& theclass == class_user && c->prefixlist != NULL)
/* User-defined commands may be subcommands. */
help_cmd_list (*c->prefixlist, theclass, c->prefixname,