From: Doug Evans <dje@google.com>
To: Pedro Alves <pedro@codesourcery.com>
Cc: gdb-patches@sourceware.org, Eli Zaretskii <eliz@gnu.org>
Subject: Re: [RFA, doc RFA] Add gdb.add_command_alias
Date: Tue, 13 Sep 2011 21:42:00 -0000 [thread overview]
Message-ID: <CADPb22Rc1vXOQeOBZMix413KvudujLvQ7F24DO+4VuAEB_WZsg@mail.gmail.com> (raw)
In-Reply-To: <201109132015.04463.pedro@codesourcery.com>
On Tue, Sep 13, 2011 at 12:15 PM, Pedro Alves <pedro@codesourcery.com> wrote:
> Hmm, what's the advantage of add_alias_cmd over add_com_alias
> (or vice versa)?
add_com_alias is just a wrapper on add_alias_cmd for a particular case.
[or did I misunderstand?]
>> but that will require a bit more syntax.
>> One would need to distinguish aliasing
>> "spe" --> "set print elements"
>> from
>> "set print foobars" --> "set print elements".
>
> Ah, right, yes, of course. That sounds useful. Irrespective
> of what we do know,
[s/know/now/ I presume]
> do you think it _shouldn't_ work?
Eh?
> Maybe it's useful.
I think so.
> E.g., `alias -f FROM -t TO' would work for me. E.g.,
>
> (gdb) alias -f "set print foobars" -t "set print elements"
>
> The command would fail if "set" or "set print" in FROM
> don't exist, or TO doesn't exist. But if that's hard,
> we can just not support it (yet at least), as long as
> we leave the door open in terms of syntax.
-f and -t seem inconsistent with the existing u/i.
I'm guessing they're there so people don't have to deal with
remembering FROM/TO ordering (a la bcopy vs memcpy, intel vs att,
etc.)
If there was a consensus on the order one could remove requiring -f/-t later.
I think I will punt on handling `alias -f "set foobars" -t "set print
elements"' for now.
[If it falls out, great, but I'm not going to worry about it.]
btw,
"!pwd" would work if find_command_name_length recognized it as a 1-char command.
But the range of acceptable command spellings still bugs me.
If TUI doesn't use +,<,> for more than single-character length commands,
I wouldn't mind at least restricting +,<,> for only single-character commands,
and then add '!' as a single char command (if only when they're the
first character).
next prev parent reply other threads:[~2011-09-13 21:35 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-09 19:25 Doug Evans
2011-09-09 21:15 ` Eli Zaretskii
2011-09-13 17:40 ` Doug Evans
2011-09-13 17:47 ` Pedro Alves
2011-09-13 19:15 ` Doug Evans
2011-09-13 19:32 ` Pedro Alves
2011-09-13 21:42 ` Doug Evans [this message]
2011-09-21 21:46 ` Doug Evans
2011-09-22 14:08 ` Pedro Alves
2011-09-22 17:45 ` Doug Evans
2011-09-22 18:13 ` Eli Zaretskii
2011-09-22 21:48 ` Doug Evans
2011-09-23 11:40 ` Eli Zaretskii
2011-09-13 18:49 ` Pedro Alves
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=CADPb22Rc1vXOQeOBZMix413KvudujLvQ7F24DO+4VuAEB_WZsg@mail.gmail.com \
--to=dje@google.com \
--cc=eliz@gnu.org \
--cc=gdb-patches@sourceware.org \
--cc=pedro@codesourcery.com \
/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