From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8817 invoked by alias); 13 Sep 2011 21:35:42 -0000 Received: (qmail 8540 invoked by uid 22791); 13 Sep 2011 21:35:40 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.44.51) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 13 Sep 2011 21:35:25 +0000 Received: from hpaq14.eem.corp.google.com (hpaq14.eem.corp.google.com [172.25.149.14]) by smtp-out.google.com with ESMTP id p8DLZNEv025175 for ; Tue, 13 Sep 2011 14:35:24 -0700 Received: from qwa26 (qwa26.prod.google.com [10.241.193.26]) by hpaq14.eem.corp.google.com with ESMTP id p8DLJrHT020855 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Tue, 13 Sep 2011 14:35:22 -0700 Received: by qwa26 with SMTP id 26so1315552qwa.28 for ; Tue, 13 Sep 2011 14:35:21 -0700 (PDT) Received: by 10.224.204.8 with SMTP id fk8mr292828qab.211.1315949721913; Tue, 13 Sep 2011 14:35:21 -0700 (PDT) MIME-Version: 1.0 Received: by 10.224.204.8 with SMTP id fk8mr292817qab.211.1315949721654; Tue, 13 Sep 2011 14:35:21 -0700 (PDT) Received: by 10.224.80.201 with HTTP; Tue, 13 Sep 2011 14:35:21 -0700 (PDT) In-Reply-To: <201109132015.04463.pedro@codesourcery.com> References: <20110909183636.444932461B1@ruffy.mtv.corp.google.com> <201109131839.49816.pedro@codesourcery.com> <201109132015.04463.pedro@codesourcery.com> Date: Tue, 13 Sep 2011 21:42:00 -0000 Message-ID: Subject: Re: [RFA, doc RFA] Add gdb.add_command_alias From: Doug Evans To: Pedro Alves Cc: gdb-patches@sourceware.org, Eli Zaretskii Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-System-Of-Record: true X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-09/txt/msg00238.txt.bz2 On Tue, Sep 13, 2011 at 12:15 PM, Pedro Alves wrot= e: > 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. =A0That sounds useful. =A0Irrespective > 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. =A0E.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. =A0But 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 late= r. 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 com= mand. 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 comman= ds, and then add '!' as a single char command (if only when they're the first character).