From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id vLS7OHx93mLtOBoAWB0awg (envelope-from ) for ; Mon, 25 Jul 2022 07:24:44 -0400 Received: by simark.ca (Postfix, from userid 112) id DAFBE1E9E9; Mon, 25 Jul 2022 07:24:44 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=UcMBI8Vs; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 7732B1E227 for ; Mon, 25 Jul 2022 07:24:43 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 169E53840C31 for ; Mon, 25 Jul 2022 11:24:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 169E53840C31 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1658748283; bh=cyTN2ATJwNJAxkEoYCN1D7Y0ckeCZQ4SiKP/hfcdqGI=; h=Date:To:In-Reply-To:Subject:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=UcMBI8VscEdAXsVLlhdUuVIn4+jlJwufTW+KwCcGfA0isxVRHR5tSv2arAhnwACpZ u91cZHkSgVZunpZgnu5vGNL2+qZc/bUNJm6QmFhEJ3yXt/o5C7CXeOVWrDxfAkRd1Z 0+yej8pFm3lw1mvpWxh7ZCoSTNgtXlRetLUB3Wkw= Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id B19463857B8A for ; Mon, 25 Jul 2022 11:24:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B19463857B8A Received: from fencepost.gnu.org ([2001:470:142:3::e]:46232) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oFwCE-0004im-70; Mon, 25 Jul 2022 07:24:22 -0400 Received: from [87.69.77.57] (port=4666 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oFwCD-0003lB-KP; Mon, 25 Jul 2022 07:24:21 -0400 Date: Mon, 25 Jul 2022 14:24:23 +0300 Message-Id: <831qu9fna0.fsf@gnu.org> To: Philippe Waroquiers In-Reply-To: <20220725041113.185127-1-philippe.waroquiers@skynet.be> (message from Philippe Waroquiers via Gdb-patches on Mon, 25 Jul 2022 06:11:13 +0200) Subject: Re: [RFA] Allow to document user-defined aliases. References: <20220725041113.185127-1-philippe.waroquiers@skynet.be> X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Eli Zaretskii via Gdb-patches Reply-To: Eli Zaretskii Cc: gdb-patches@sourceware.org Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" > Date: Mon, 25 Jul 2022 06:11:13 +0200 > From: Philippe Waroquiers via Gdb-patches > > When using 'help ALIASNAME', GDB shows the help of the aliased command. > This is a good default behaviour. > > However, GDB alias command allows to define aliases with arguments > possibly changing or tuning significantly the behaviour of > the aliased command. In such a case, showing the help of the aliased > command might not be ideal. But it doesn't do much harm, either. Moreover, it is useful to tell the user that some handy aliases exist related to the command. > This is particularly true when defining an alias as a set of > nested 'with' followed by a last command to launch, such as: > (gdb) alias pp10 = with print pretty -- with print elements 10 -- print > Asking 'help pp10' shows the help of the 'with' command, which is > not particularly useful: > (gdb) help pp10 > with, pp10, w > alias pp10 = with print pretty -- with print elements 10 -- print > Temporarily set SETTING to VALUE, run COMMAND, and restore SETTING. > Usage: with SETTING [VALUE] [-- COMMAND] > .... Maybe help for an alias shouldn't show the original commands, but help for "with" could usefully mention pp10. Or maybe we should be smarter and show only the help for pp10 when help for "print" was requested. > Such an alias can now be documented by the user: > (gdb) document pp10 > >Pretty printing an expressiong, printing 10 elements. > >Usage: pp10 [PRINT-COMMAND-OPTIONS] EXP > >See 'help print' for more information. > >end > (gdb) help pp10 > Pretty printing an expressiong, printing 10 elements. > Usage: pp10 [PRINT-COMMAND-OPTIONS] EXP > See 'help print' for more information. > (gdb) > > When a user-defined alias is documented specifically, help and apropos > use the provided alias documentation instead of the documentation of > the aliased command. > > Such a documented alias is also not shown anymore in the help of the > aliased command, and the alias is not listed anymore in the help > of the aliased command. When you say "such a documented alias", do you mean that by just documenting the alias has this effect? IMO, this could be too far-fetched. How about adding some specific attribute of the command to that effect, instead of re-purposing the documentation attribute? > +(@pxref{Command aliases default args,}). ^ That comma should be deleted. The documentation parts are OK, assuming that the implementation is accepted. Thanks.