From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,NICE_REPLY_A,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 30870 invoked from network); 20 Nov 2022 13:48:15 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 20 Nov 2022 13:48:15 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1668952095; b=q4cDkSsRhykbEbBULgH5dy0LnJAuOXfK7TiLPtnd1921tPRhsiYMg6EhMEuTqEcvmso2iDW9Af b5XKJt2A0NtZBsBPhoJCe7oDG6hSdvbdvcf76JQ3bpRQ+AGFnYNj/MlhDg5K/XnHcaiipB2lvR tethZ4BKOpKsJDA8XgnaHgCRwcRlW99pSE2NQculL/CmBKKu2vYgBVCbYs8uMpRH1xmbS5tatB Ntm7G3EpOD8bzWjfkdolcsV2xPYWpmV3HcIz3UdJrsUZkVNPGkuklGPgzc8NtVDXCmh15+9c09 G9rYlDOWxFO/IdVQYm2Togzorfyjl3GuugP8b9zIQYG64g==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mta04.eastlink.ca) smtp.remote-ip=24.224.136.10; dmarc=none header.from=eastlink.ca; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1668952095; bh=038OX03/U9G0oYm3n1EnaBl+/D3/qqp2aXjZuPSkV2s=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:To:Subject:MIME-Version:Date:Message-ID:DKIM-Signature; b=mRUsvi4PXF/wclooHE06tRA37e7zXqy5/QJKpw4WS/RkomxWurVN6EF6etRMMpthlXHIlSSa6z kNt+olwOEWy642i7sa9enHYVdX4L5loLBv9hnFhlKrm6kQ6/bCoLO9xozalYDp3cEORyxpfoj9 peMljj6BNYe2J86l5e1Vjhmq2RY2Pem8co/SVYs40lLnG2z0uRex23mXR44itIzvCl26qFZf6v +wQYq+FjTHiCy+oSSOsq7SL5pVakOMHSmNtEw1DMMLyx2V4uOxaFCSsT+990y37UR2kDHPRsdq yXMqCQo6kazddMfiH8UWrFpD6SuJaddbYnKWR1w9XvaSHg==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-transfer-encoding: Content-type:In-reply-to:From:References:To:Subject:MIME-version:Date: Message-id:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From :Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=CEtHbdFCo1EFswc0F43AXxf4Shr822qIE2uUoTaqIc8=; b=gMNhIhnsn9Z91EvYNOg5k3Brqj eY4Fx083W+8zmIdkwMuc27XzrYYFmjfEx0dnoVx3iawDQ5AZMTWHLPL9LVoqGxHqf6RyVbegoZkfC bv2t3iRtiDvFm6KKorKpBcsS5H0s/WB2Krg4z2zAqZbQSrYwTTvSjVUoH4b9OSonRj91/drog1/hp mc/2NgAyRFIGGt/gGrpdMCirWxTedAUwKOtpWZ51RERCuiBFaJ+ftxk5bDLLCVxvIVwDadv5zjBuf hQ+iBSztyeoQ1q2W8okHRmDW/mKKzvyZ0zrdl5QPDfWnBGwL3qeKVN9PtPMxUvDr9Av1TPFTWFfc4 N2KDnjbw==; Received: by zero.zsh.org with local id 1owkg9-000Ilz-ME; Sun, 20 Nov 2022 13:48:13 +0000 Authentication-Results: zsh.org; iprev=pass (mta04.eastlink.ca) smtp.remote-ip=24.224.136.10; dmarc=none header.from=eastlink.ca; arc=none Received: from mta04.eastlink.ca ([24.224.136.10]:34935) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) id 1owkfX-000I3z-L4; Sun, 20 Nov 2022 13:47:36 +0000 Received: from csp02.eastlink.ca ([71.7.199.167]) by mta04.eastlink.ca (Oracle Communications Messaging Server 8.0.2.2.20180531 64bit (built May 31 2018)) with ESMTPS id <0RLN0021IF0KRM80@mta04.eastlink.ca> for zsh-users@zsh.org; Sun, 20 Nov 2022 09:47:34 -0400 (AST) Received: from [192.168.0.4] ([24.207.18.108]) by Eastlink with ESMTPSA id wkfVoWZW8gfyjwkfWoiI7Q; Sun, 20 Nov 2022 09:47:34 -0400 X-Authority-Analysis: v=2.4 cv=M9uLaQ8s c=1 sm=1 tr=0 ts=637a2ff6 a=xN66ZtSbq5jdJYpBp7G/jQ==:117 a=xN66ZtSbq5jdJYpBp7G/jQ==:17 a=IkcTkHD0fZMA:10 a=w335PXPY5OxSD01S0GsA:9 a=QEXdDO2ut3YA:10 X-Vade-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrheeggdefudcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfgtefuvffnkffpmfdpqfgfvfenuceurghilhhouhhtmecufedttdenucenucfjughrpefkffggfgfuvfhfhfgjtgfgsehtkeertddtfeejnecuhfhrohhmpeftrgihucetnhgurhgvfihsuceorhgrhigrnhgurhgvfihssegvrghsthhlihhnkhdrtggrqeenucggtffrrghtthgvrhhnpeeitdejffevgfdtheeggfetkeeugeegieetuddtvddvudetteffvdevlefgueekudenucfkphepvdegrddvtdejrddukedruddtkeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpedvgedrvddtjedrudekrddutdekpdhhvghloheplgduledvrdduieekrddtrdegngdpmhgrihhlfhhrohhmpehrrgihrghnughrvgifshesvggrshhtlhhinhhkrdgtrgdpnhgspghrtghpthhtohepvddprhgtphhtthhopeerredprhgtphhtthhopeiishhhqdhushgvrhhsseiishhhrdhorhhgpdhgvghtqdgkihhprfgrshhsfigupehtrhhuvg X-Vade-Score: 0 X-Vade-State: 0 X-EL-AUTH: rayandrews@eastlink.ca Message-id: Date: Sun, 20 Nov 2022 05:47:33 -0800 MIME-version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Subject: Re: why is eval needed? To: zsh-users@zsh.org References: <20221119164852.hwujmufa6hn5lotr@chazelas.org> <352823cc-954a-fa79-d830-d69d593b1c02@eastlink.ca> <3fa3f7ff-1733-4730-a62f-dd0e138c3b72@app.fastmail.com> <20221120085519.szudhyg5ewrw3b4o@chazelas.org> Content-language: en-US From: Ray Andrews In-reply-to: <20221120085519.szudhyg5ewrw3b4o@chazelas.org> Content-type: text/plain; charset=UTF-8; format=flowed Content-transfer-encoding: 8bit X-Seq: 28420 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: , List-Subscribe: , List-Unsubscribe: , List-Post: List-Owner: List-Archive: On 2022-11-20 00:55, Stephane Chazelas wrote: It's the caller's role to pass tree, -L and 1 as separate > arguments. Yeah I get it.  The first time I 'got it' was when discussing 'aptitude' and the various quotings needed.  Again one is creating an invisible level of organization imposed on a string of characters.  Where it got confusing was when zsh imposed it's own ideas of grouping, making '-L 2' into a single entity.  Dunno if it's really a thing to be desired but naively one might like some way of assembling a command string as if it was at CLI, that is *just* a string of characters -- which is how I was looking at it. > tree parses its options. It looks like it does not use the > standard getopt() API or the GNU getopt_long() API for that: > > $ nm -D =tree | grep -i getopt > $ ltrace -e '*opt*@*' tree > /dev/null > +++ exited (status 0) +++ What are you doing there?  I have no 'nm' command here.  No such command in Debian repository. > > So it must be doing it by hand. Yeah, so much in the GNU/Linux world is ad hoc.  Everybody did their own thing.  No rules. > In any case zsh (or perl) has no saying on how tree may parse > its options. You have to invoke it the way its meant to be > invoked and in the case of tree, the option arguments must be > passed as separate arguments. Sure.  The main thing is to just understand that.  Not too difficult when you do, something might need splitting or joining but it won't take long to figure out.  But why does calling 'eval' fix it?  It seems as if eval 'flattens' everything -- one is back to a command line string of characters with no imposed grouping. > > For most other commands, you would be able to pass them either > as one -L1 argument or two -L and 1 arguments and also be able > to combine more than one option in a single argument as in > -xyL1 (assuming -x and -y are options that don't take > arguments, are flags/boolean). > Yeah, as I was saying, it does seem that 'tree' is very crabby. Why don't the GNU people iron these things out?