From patchwork Mon Apr 4 20:48:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 11624 Received: (qmail 96056 invoked by alias); 4 Apr 2016 20:48:27 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 96022 invoked by uid 89); 4 Apr 2016 20:48:26 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00, SPF_PASS autolearn=ham version=3.3.2 spammy=userdefined, user-defined X-HELO: usplmg20.ericsson.net Received: from usplmg20.ericsson.net (HELO usplmg20.ericsson.net) (198.24.6.45) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Mon, 04 Apr 2016 20:48:25 +0000 Received: from EUSAAHC004.ericsson.se (Unknown_Domain [147.117.188.84]) by usplmg20.ericsson.net (Symantec Mail Security) with SMTP id B1.BE.30335.8FCC2075; Mon, 4 Apr 2016 22:22:17 +0200 (CEST) Received: from elxcz23q12-y4.dyn.mo.ca.am.ericsson.se (147.117.188.8) by smtps-am.internal.ericsson.com (147.117.188.84) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 4 Apr 2016 16:48:23 -0400 From: Simon Marchi To: CC: Simon Marchi Subject: [PATCH] Don't show deprecated commands in help Date: Mon, 4 Apr 2016 16:48:18 -0400 Message-ID: <1459802898-18656-1-git-send-email-simon.marchi@ericsson.com> MIME-Version: 1.0 X-IsSubscribed: yes 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. --- gdb/cli/cli-decode.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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,