This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA, doc RFA] Add gdb.add_command_alias
- From: Eli Zaretskii <eliz at gnu dot org>
- To: dje at google dot com (Doug Evans)
- Cc: gdb-patches at sourceware dot org
- Date: Sat, 10 Sep 2011 00:13:15 +0300
- Subject: Re: [RFA, doc RFA] Add gdb.add_command_alias
- References: <20110909183636.444932461B1@ruffy.mtv.corp.google.com>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> Date: Fri, 9 Sep 2011 11:36:36 -0700 (PDT)
> From: dje@google.com (Doug Evans)
>
> Per discussion on IRC, here is a patch to add support for adding
> command aliases.
I wish people would discuss such issues here, not on IRC. These
discussions should be recorded, for one thing.
Me, I don't understand the need for this feature, especially not why
it should be a Python-only feature. Moreover, why do we need to have
this, when one can easily write a command that just calls an existing
one, to have the same effect.
> valid_cmd_name_p is more restrictive than it could be.
> E.g. gdb allows a user-defined command named "42", but
> "it's easier to relax restrictions than it is to impose them after the fact",
> so I'm going with this.
Sorry, I don't understand what this is about. I guess that was again
discussed "on IRC" or wherever.
> + NOTE: TUI has a few special commands, +, <, >.
> + We don't watch for those here. */
Why not? And what does that mean in terms of user expectations?
> +This is useful, for example, when you want to be able to type a command
> +with a long name using fewer characters, and the contraction is otherwise
> +ambiguous. It can also we used when you want to give a command an alternate
^^
"be"
> +@var{name} is the name of the new command.
> [..]
> +Command names must begin with a letter, dash or underscore,
> +and must consist of letters, numbers, dashes and underscores.
@var{name} is the name of the new command; it must begin with a
letter, dash or underscore, and must consist of letters, numbers,
dashes and underscores.
> +@var{command_class} should be one of the @samp{COMMAND_} constants.
Please add here a cross-reference to where these constants are
documented.