* [PATCH] Don't show deprecated commands in help
@ 2016-04-04 20:48 Simon Marchi
2016-04-19 11:30 ` Pedro Alves
0 siblings, 1 reply; 4+ messages in thread
From: Simon Marchi @ 2016-04-04 20:48 UTC (permalink / raw)
To: gdb-patches; +Cc: Simon Marchi
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,
--
2.8.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Don't show deprecated commands in help
2016-04-04 20:48 [PATCH] Don't show deprecated commands in help Simon Marchi
@ 2016-04-19 11:30 ` Pedro Alves
2016-04-28 18:19 ` Simon Marchi
0 siblings, 1 reply; 4+ messages in thread
From: Pedro Alves @ 2016-04-19 11:30 UTC (permalink / raw)
To: Simon Marchi, gdb-patches
On 04/04/2016 09:48 PM, Simon Marchi wrote:
> 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.
Seems fine to me.
This made me wonder about whether a "help deprecated" command would
be useful, so a user could clearly/quickly see which commands are
now deprecated.
Also wonder whether we should do something to "apropos". I guess it
could/should go the same way as help, not sure. At least
"apropos deprecated" shows a few hits, but then again deprecated
commands was what I wanted to find.
Thanks,
Pedro Alves
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Don't show deprecated commands in help
2016-04-19 11:30 ` Pedro Alves
@ 2016-04-28 18:19 ` Simon Marchi
2016-05-02 13:51 ` Pedro Alves
0 siblings, 1 reply; 4+ messages in thread
From: Simon Marchi @ 2016-04-28 18:19 UTC (permalink / raw)
To: Pedro Alves, gdb-patches
On 16-04-19 07:30 AM, Pedro Alves wrote:
> On 04/04/2016 09:48 PM, Simon Marchi wrote:
>> 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.
>
> Seems fine to me.
Thanks, I pushed it.
> This made me wonder about whether a "help deprecated" command would
> be useful, so a user could clearly/quickly see which commands are
> now deprecated.
Yes, that would be nice.
> Also wonder whether we should do something to "apropos". I guess it
> could/should go the same way as help, not sure. At least
> "apropos deprecated" shows a few hits, but then again deprecated
> commands was what I wanted to find.
It would make sense if apropos also didn't show deprecated commands.
Those sound like relatively easy tasks, which would be perfect for new
contributors. I read this some time ago, I was wondering if we should
have something like that in gdb:
https://medium.com/@kentcdodds/first-timers-only-78281ea47455#.txao561fn
Perhaps we could have a keyword for them in BZ... WDYT?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Don't show deprecated commands in help
2016-04-28 18:19 ` Simon Marchi
@ 2016-05-02 13:51 ` Pedro Alves
0 siblings, 0 replies; 4+ messages in thread
From: Pedro Alves @ 2016-05-02 13:51 UTC (permalink / raw)
To: Simon Marchi, gdb-patches
On 04/28/2016 07:19 PM, Simon Marchi wrote:
> Those sound like relatively easy tasks, which would be perfect for new
> contributors. I read this some time ago, I was wondering if we should
> have something like that in gdb:
>
> https://medium.com/@kentcdodds/first-timers-only-78281ea47455#.txao561fn
>
> Perhaps we could have a keyword for them in BZ... WDYT?
Sounds like a good idea.
We have the https://sourceware.org/gdb/wiki/ProjectIdeas page with some
ideas, though I don't think that has managed to attract much help in practice.
Got a suggestion for a keyword? I can add it.
Thanks,
Pedro Alves
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-05-02 13:51 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-04 20:48 [PATCH] Don't show deprecated commands in help Simon Marchi
2016-04-19 11:30 ` Pedro Alves
2016-04-28 18:19 ` Simon Marchi
2016-05-02 13:51 ` Pedro Alves
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).