From: Simon Marchi <simark@simark.ca>
To: Philippe Waroquiers <philippe.waroquiers@skynet.be>,
gdb-patches@sourceware.org
Subject: Re: [RFAv3 1/4] Implement user defined prefix.
Date: Sat, 30 Nov 2019 04:09:00 -0000 [thread overview]
Message-ID: <ea930d68-3d4d-a14d-30ba-59055b57b930@simark.ca> (raw)
In-Reply-To: <20191128200901.27511-2-philippe.waroquiers@skynet.be>
On 2019-11-28 3:08 p.m., Philippe Waroquiers wrote:
> diff --git a/gdb/cli/cli-script.c b/gdb/cli/cli-script.c
> index 06cdcd6bfe..066a596fdc 100644
> --- a/gdb/cli/cli-script.c
> +++ b/gdb/cli/cli-script.c
> @@ -29,6 +29,7 @@
> #include "cli/cli-cmds.h"
> #include "cli/cli-decode.h"
> #include "cli/cli-script.h"
> +#include "cli/cli-style.h"
>
> #include "extension.h"
> #include "interps.h"
> @@ -1395,7 +1396,17 @@ do_define_command (const char *comname, int from_tty,
> int q;
>
> if (c->theclass == class_user || c->theclass == class_alias)
> - q = query (_("Redefine command \"%s\"? "), c->name);
> + {
> + /* if C is a prefix command that was previously defined,
> + tell the user its subcommands will be kept, and ask
> + if ok to redefine the command. */
> + if (c->prefixlist != nullptr)
> + q = c->user_commands.get () == nullptr
> + || query (_("Keeping subcommands of prefix command \"%s\".\n"
> + "Redefine command \"%s\"? "), c->name, c->name);
Just a nit here before you push, format the multi-line expression line like this, with
a parenthesis:
q = (c->user_commands.get () == nullptr
|| query (_("Keeping subcommands of prefix command \"%s\".\n"
"Redefine command \"%s\"? "), c->name, c->name));
Simon
next prev parent reply other threads:[~2019-11-30 4:09 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-28 20:09 [RFAv3 0/4] More flexible user-defined commands prefixing and naming Philippe Waroquiers
2019-11-28 20:09 ` [RFAv3 1/4] Implement user defined prefix Philippe Waroquiers
2019-11-30 4:09 ` Simon Marchi [this message]
2019-11-28 20:09 ` [RFAv3 3/4] Allow . character as part of command names Philippe Waroquiers
2019-11-28 20:09 ` [RFAv3 4/4] Document define-prefix command and the use of . in " Philippe Waroquiers
2019-11-28 20:09 ` [RFAv3 2/4] Test define-prefix Philippe Waroquiers
2019-11-30 3:36 ` [RFAv3 0/4] More flexible user-defined commands prefixing and naming Simon Marchi
2019-11-30 8:55 ` Philippe Waroquiers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ea930d68-3d4d-a14d-30ba-59055b57b930@simark.ca \
--to=simark@simark.ca \
--cc=gdb-patches@sourceware.org \
--cc=philippe.waroquiers@skynet.be \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).