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.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 22099 invoked from network); 21 Jul 2022 01:37:08 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 21 Jul 2022 01:37:08 -0000 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-Type:Subject:Cc:To:From:Date: References:In-Reply-To:Message-Id:Mime-Version:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=g7vZRn6WZuUiUcn+GnWfsCf3I13LuAazG3H5blc1eGQ=; b=njLrNZuM4hXjEODSLYZuNj8aWy aU+VoLGJ/EuqUyiTFEf2cnSI2BoyN/PpEN7SMeQ0nvw99n2fESKu2FyTSMwWNwp/TxkBStb6DLgSV oSORzEFo+lDZVqcyhCUumsKS/VndJGJdOL/125w1dNUax/0HdB5MXkxy3CJ8I/Cfjt2VOrGCwM27b Lkv5L5PdwkVZ1SBydzbjbigdEtQcCFk3zDYfPyYDdqvFfjkTrPWesBJi2s1Wusuq7hsk4zBaZOjIj pfgTyXU3hCRmTDh66bjKIW0LuokI4Hv8SoealszfOhwCcQWI/ho/LteEK8Q8yZ+Ab+PlHpWORj1bN FzY3aHSg==; Received: from authenticated user by zero.zsh.org with local id 1oEL7j-000AYC-5c; Thu, 21 Jul 2022 01:37:07 +0000 Received: from authenticated user by zero.zsh.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1oEL6s-0009si-FC; Thu, 21 Jul 2022 01:36:14 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailauth.nyi.internal (Postfix) with ESMTP id D039A27C0054; Wed, 20 Jul 2022 21:36:12 -0400 (EDT) Received: from imap48 ([10.202.2.98]) by compute2.internal (MEProxy); Wed, 20 Jul 2022 21:36:12 -0400 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrudelfedgfedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefofgggkfgjfhffhffvvefutgesth dtredtreerjeenucfhrhhomhepnfgrfihrvghntggvpgggvghljoiiqhhuvgiiuceolhgr rhhrhihvseiishhhrdhorhhgqeenucggtffrrghtthgvrhhnpeehfffhueejheeugffgfe euudffledvleegffeuhedvveekueegiedugfelueefteenucevlhhushhtvghrufhiiigv pedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehlrghrrhihvhdomhgvshhmthhprghuth hhphgvrhhsohhnrghlihhthidqudduhedukeejjedtgedqudduledvjeefkeehqdhlrghr rhihvheppeiishhhrdhorhhgsehfrghsthhmrghilhdrtghomh X-ME-Proxy: Feedback-ID: iaa214773:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 8CF3131A0062; Wed, 20 Jul 2022 21:36:12 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.7.0-alpha0-755-g3e1da8b93f-fm-20220708.002-g3e1da8b9 Mime-Version: 1.0 Message-Id: <645ba344-9d97-4ddf-82c6-e6338c98da8b@www.fastmail.com> In-Reply-To: References: <28c00da7-cfdd-4f58-a539-8deebbe5dfa5@www.fastmail.com> Date: Wed, 20 Jul 2022 21:35:51 -0400 From: =?UTF-8?Q?Lawrence_Vel=C3=A1zquez?= To: "Anthony Heading" Cc: zsh-users@zsh.org Subject: Re: view onto command pipeline? Content-Type: text/plain X-Seq: 27911 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 Wed, Jul 20, 2022, at 8:15 PM, Anthony Heading wrote: > Agree > quoting $@ makes sense here since this is a wrapper, but I find more > often dropping empty > arguments is often very helpful after splits and suchlike. > > But as to "${opts[@]}"... Just too ugly to do that all the time, no? > Instead, use > zsh's awesome sticky emulation: > > emulate zsh -c 'autoload -Uz ~/my-zsh-funcs/*' Leaving $opts[@] unquoted still elides empty elements in this context; that behavior is not limited to $@. (If this is what you actually want, go for it. Just don't think that fiddling with options has an effect.) > Very helpful for insulating the risks of unexpected option settings, > and makes it > safe to use unquoted variables. As a rule of thumb, at least :-) It's better to run ''emulate -L zsh'' inside the function itself (or localize and [un]set options individually as desired) to achieve a known state, rather than relying on a specific method of invocation. -- vq