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 31373 invoked from network); 15 Apr 2021 19:58:14 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 15 Apr 2021 19:58:14 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1618516694; b=o/rJ6ZaNkAo9TR2yfZmxPw5CteRD4sdl0d9/uJXbEV6srmqqI0txUoVR3ixOEzZnFSM370xKg/ qqBP664RCwUWnsvd55LDpdZ7q5+LCoEY8zojULNtkEliwpVMvC8SirGIjAgVYJv/dMP3YGB0CN 4OD8ueTxclt9hBIBP6gbhFzv658NfImlO9wJOJi1Rzhi2zg5yVPKAm2vQmSD6B0tndgG6i7KcO ptkPM8L+gEIEkW+tvJnc5KXlGeZfX6W8/pGZynfhh+09m12VjOmIQHr9S4L+LaEV1ZQSVY35W5 Ve0zEjwq3dHI+FLROVrIKXqXvYi006i6ZZP87vQGov3eUA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (aurora-borealis.phear.org) smtp.remote-ip=188.42.45.194; dkim=pass header.d=phear.org header.s=20180217 header.a=rsa-sha256; dmarc=none header.from=phear.org; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1618516694; bh=+5v4s8hSe+YIIg1QxFRSx0TWi9Vl0ZIp672BWo6SNA0=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:DKIM-Signature:DKIM-Signature; b=i2aRqAo3D8M7VR2lYgfitcGmiKBmLH2o8TPEdeLapV1oSAy17l4bPxW8iDjCV4d6q3QYTamOiC 4mbpvh9WvsJKGfWfUf2764sIl7vpwhT5yPFfVr2o2pG9PA8I5Y0THlDWhjB6vermP3BOKajiI7 R8kB+f04XRkRKZsqk4SQMxWLNc9V9L37rTl4dTLuVgO5vFJZQeX9+QKCIzNynBYijE3wtAidzT +leaMioiVm+rxV/JrtgaVDZk4DWNm9xMuqb17+sGTw8ZvIDSyA+J5eDvlN/BNVgAfpgNGQ+F7o SIjRps/axcHTFg/MNTS8bchhQK4NwptxBpRp8FKrX9S4ng==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20200801; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=niQPpLWcG4Um0rg0tat3spPEPyoAXFZRv3L5xzscEXs=; b=PYLfV5U1bYLQMKBUuqRuOOJbR9 qeBvlanKyOnuWLagFuoA2Tltr8GqaNVzh6YwEp6arPrOelaEa1Ft4I8rFHqD0dtyLF4D4ox4wMwPU 0apfkSwTbwwnQ3ecdD915s8h8icDF6CNZ2JMjQkRqQX73IXtjpxt7eEwPWpCl6R/8G3si0FAC8gzM 8BMPJT0Ch4HIYHgiURHXNwTQKn13j5PLsO/2JoLD/HUnxzm9DmkIs1iN6Pgf0ckcCFqjUZnrxu0Iu PuVtsiiZtMwmoJ1qVp2vf0NWllXLRvKbL6Gn9KZ6ytnWMEliK9lupZThbz1mJWsqXcBXLMhSbhG7h TwJKCXqA==; Received: from authenticated user by zero.zsh.org with local id 1lX87t-000Kt0-Qz; Thu, 15 Apr 2021 19:58:09 +0000 Authentication-Results: zsh.org; iprev=pass (aurora-borealis.phear.org) smtp.remote-ip=188.42.45.194; dkim=pass header.d=phear.org header.s=20180217 header.a=rsa-sha256; dmarc=none header.from=phear.org; arc=none Received: from aurora-borealis.phear.org ([188.42.45.194]:42404) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1lX867-000KH5-RA; Thu, 15 Apr 2021 19:56:20 +0000 Received: from localhost (unknown [127.0.0.1]) by aurora-borealis.phear.org (Postfix) with ESMTP id E0708FF32; Thu, 15 Apr 2021 19:56:17 +0000 (UTC) X-Virus-Scanned: amavisd-new at phear.org Received: from aurora-borealis.phear.org ([127.0.0.1]) by localhost (mail.phear.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id y1s6CIvnxN6h; Thu, 15 Apr 2021 19:56:14 +0000 (UTC) Received: from prometheus.u-strasbg.fr (82-65-50-238.subs.proxad.net [82.65.50.238]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: khatar) by aurora-borealis.phear.org (Postfix) with ESMTPSA id 0777FFF0D; Thu, 15 Apr 2021 19:56:13 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.10.3 aurora-borealis.phear.org 0777FFF0D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=phear.org; s=20180217; t=1618516574; bh=+5v4s8hSe+YIIg1QxFRSx0TWi9Vl0ZIp672BWo6SNA0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=TZX58GtRzvu0HWLRB28UBz0JBg02qEj6SghTWbZiIeCYiwkiFhZFofNkGoywjzhpl 8y+Zqm8M141QG2iHiTFF5taP21CebNMtOUdvEI/UfG7C5xqpdTKCJAmt449ADuJBEV SWzzNvpGHwO/9M5c3R5gqeVFjqOYkBTP0dB9M9c0Y3DPw8Ru9G0A1UsBWBVNgKhn/j JR67zFQvo4trTAmRMonuPDnwOsM+oItcV9zodwB2TQtzALoKH63M2TYivTSfp1Yqsv 312u1W1V6pTk/CPIGAZXcoDM7EPfxpY4wPA0sfM1tH/2wpIs9UxM/QBVAtUshj8urv D8uiw7LbqHQSw== Date: Thu, 15 Apr 2021 21:56:12 +0200 From: Marc Chantreux To: Bart Schaefer Cc: zzapper , Zsh Users Subject: (prefix case terminators?) Re: alias with a parameter Message-ID: References: <20210407070518.szoet4rxbouwzelm@chazelas.org> <2902540a-9c07-4423-b0bb-6802af6e97a2@www.fastmail.com> <48bef9cb-fea7-1a17-96b1-dd4ae7bf54aa@spamtrap.tnetconsulting.net> <20210409224930.GB6760@tarpaulin.shahaf.local2> <41baeb56-de2f-2fb2-3544-ce703bf96223@rayninfo.co.uk> <6717f359-f340-a436-c2dd-1b9ae19d345a@rayninfo.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Seq: 26654 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: > However you really don't need that test at all: > case "$1" in > ("") false;; > ([A-Z]|V<->|G*);; > (*) echo "Yes expand";; > esac i would have written ${1-} so -u can be used. also: i really think that using terminators as "continuation" ease the code reading because * it makes code more aligned * it's easier to spot a different terminator than ;; case "${1-}" in ('') do_nothing ;; (hello*) greetings ;| (*world) greetings # twice ;; (long) multiple commands comes in indented lines ;; esac regards marc