From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: from zero.zsh.org (zero.zsh.org [IPv6:2a02:898:31:0:48:4558:7a:7368]) by inbox.vuxu.org (Postfix) with ESMTP id 93C972B88C for ; Mon, 4 Nov 2024 18:15:49 +0100 (CET) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1730740549; b=dX7kbEGjRllnWemumcFk6X3ojm1X3J+N6/Q7m3nOoBZ4qCCV5zWJnx1f1IjyjvVBhGKpW2Q0Rr lLAIxpL9sCcc/EP4KSVt6EEqJ6EwfdhGr2AN42MahU67YDIi2wKf6bXe6vltTjLbflH4+KY45w 68sR/ZKLk4HCNRkqalAgRclXNdWt9+Yhz7UvefZHpIs2Yy6FB1VYfla1P/bQSp1UbAEoRIb1Tg pz6WpAWudu3AvEPjKAUZ0jkGMGydUJHCuzXZ42GOpjLCi2vC0vU4rSJg1MyHYYIwaCnkHBZ5hw fROQrHz03XgSSUXTJ+Ha8J9f8kWpnM9X+U9z7kGUyfuNew==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ej1-f44.google.com) smtp.remote-ip=209.85.218.44; dkim=pass header.d=brasslantern-com.20230601.gappssmtp.com header.s=20230601 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1730740549; bh=GfNksHoF5AwtcSOVUWCJKwXuuJgX+5gPvf7EZOCsf+8=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:To:Subject:Message-ID: Date:From:In-Reply-To:References:MIME-Version:DKIM-Signature:DKIM-Signature; b=FzXj/T+7yebS8y+l5p5fnsia3V+s2CbixAgcerDa073eQlef6S35yEGEhyVW4Jpo0Tl7RJCiM1 pjiqJTgCrC+00htvhH9UfAwd4IYpIblCNZnBVrq2jwdHPePBhwRlJfVCI9B0bn4r3WRVE3O06h cFnVrMYfjJAFq2hlD1hsz5YyN0Z545lVTLynq7z+Y/oxN0V9bklfUKqQ0OXspWgau6gbJ5JgHR pI03o7yDWrmitvVMPKrPke+AgM1Nlf7PuCOL01FhrfdV5edzQS3pfEY1SCARrbLYIuWly0YMpG eB+vUcxjnaRbNDrVpCszNIC94+lE6S1h0seZGzGK0coTpA==; 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:To:Subject:Message-ID:Date:From:In-Reply-To:References: MIME-Version:Reply-To:Cc:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=GfNksHoF5AwtcSOVUWCJKwXuuJgX+5gPvf7EZOCsf+8=; b=gWePpegmn5MaxCWXcHJwSNepGb ihu8vMuuDvm/c1sC7Lh6oZIdkQ4nal2KWoZroRNMSbZbb04Fir/+FOlVSJ71NaiQ9HfwxQNM+EA3w d8yFqvjZx6O2zjPYO3nif5DiA2XXtNsn+zFFbwMgvYMyZfxrYnHtqH8izxIBHGMbyBsEok4h8a6jw zSIlyq8OJcOhbb3IEArUkRZZVZQ7DFrGlbZ3qMy197ZLvZ41gl8MJ8avlls03AwOUW0rdGcRtFjF4 YPAdG7C7wkUCOJDqPU6UhHYMn3w56WKJ2AtVM17O9RdDwFhvCJEX9A5k7U5VPPIFtwSr371ZmnFlX WwYf+6WA==; Received: by zero.zsh.org with local id 1t80g8-000Fxv-WD; Mon, 04 Nov 2024 17:15:49 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ej1-f44.google.com) smtp.remote-ip=209.85.218.44; dkim=pass header.d=brasslantern-com.20230601.gappssmtp.com header.s=20230601 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-ej1-f44.google.com ([209.85.218.44]:38734) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1t80fQ-000FAs-KZ; Mon, 04 Nov 2024 17:15:05 +0000 Received: by mail-ej1-f44.google.com with SMTP id a640c23a62f3a-a9a017a382bso87061966b.3 for ; Mon, 04 Nov 2024 09:15:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20230601.gappssmtp.com; s=20230601; t=1730740504; x=1731345304; darn=zsh.org; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=GfNksHoF5AwtcSOVUWCJKwXuuJgX+5gPvf7EZOCsf+8=; b=EudPYqGychKulnZfia4gkaLqWIfb/7Stf1dKQBAemnFOt/WGQv0SmfZ2dHKysdCR/f pxg+bBbV4vKSt9DqjNSeCcxHEOgbmDd+KfSWOk5Z/pl5tPzv0M+6LdpPcFaWiPFkNv7p 3L60GksgYWMVsG+ZX6SP3yQniMxEvME6IR4uinAmT2sVNSjwflHEjIAD/ADEtV4IDTMc 9zcZ3th6n3zNr37B8GOtCvSfQe+pkRcyGMyy/52FXSA3Y6o2H2M2OOmp7qr2skIUvkNV SovbyIpD0C90fcpzRy5muKzMj/Kr1fHtTY7chEg5NGK+zU18atmdnhULd+ViP5vNliWL /87w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730740504; x=1731345304; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GfNksHoF5AwtcSOVUWCJKwXuuJgX+5gPvf7EZOCsf+8=; b=IVuXxjH9gcaFX5R75kHQtTE6IZyP4tBaLrJv2bk3MMg9W6kBRXlf26QGt55+T4Jvl0 JMY0cNwXvJxGuASwNakAPQtCkWKH7ThSF59w+d/F1qMak/xfI/ANwQ6PnsYkSiLsHChM lv9yeK+9rKyRD7b4pKBmbA6RoEDmQ+rR1PmmaOZk5MmDd7O7fmV4Dz4yVp/iQM2a2KWM 9m/1VGpsZv+hcrZuJQnTs+z1aVG00v5grH8conyWNndXCh+9C7rDiyDbht2p5XNWd1Jr s+jyYgIogvnOZI0xeWhg9YqEzz4FBwgpjAYaFzq3uYAFuzq35xdAw9Vcjh3pk3mpEIx5 kA5g== X-Gm-Message-State: AOJu0YwpPkX55iRsKM836kTEFLrQUEv3Pn45Cnvqqi3E5Jb4bqOVMzCm X0u5hoXngVm9/AL5Zvx/1OJ94TbVN3dJ/TSYnl+m61G95umagFg4b4UohBOULpcciGP5jWmAFdc ExoSJasdp9Q39YqramD4jYVe2rWS7mSUdYcuH97vZTuCj7iZuGne8 X-Google-Smtp-Source: AGHT+IHlsRLT6VKhMZjE8pZ/JwonHqmys0A2xzpgNGigC3ZJogT4XZRhrxc0OwDon2wEB0c/8+M679szoN9Snr6liKc= X-Received: by 2002:a17:907:7f0e:b0:a9a:147d:fec2 with SMTP id a640c23a62f3a-a9de5f04397mr1190750866b.6.1730740503813; Mon, 04 Nov 2024 09:15:03 -0800 (PST) MIME-Version: 1.0 References: <1679858811.2827593.1730739588559@mail.virginmedia.com> In-Reply-To: <1679858811.2827593.1730739588559@mail.virginmedia.com> From: Bart Schaefer Date: Mon, 4 Nov 2024 09:14:52 -0800 Message-ID: Subject: Re: complete as some other sub command To: Zsh-Users List Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Seq: 30096 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 Mon, Nov 4, 2024 at 8:59=E2=80=AFAM Peter Stephenson wrote: > > Others may be able to think of gotchas requiring something a bit > more sophisticated. There's the "as if" function posted a few days ago to zsh-workers -- haven't tried it myself. compdef '_as_if git diff' gd diff --git a/Completion/Base/Utility/_as_if b/Completion/Base/Utility/_as_i= f new file mode 100644 index 000000000..84777ee32 --- /dev/null +++ b/Completion/Base/Utility/_as_if @@ -0,0 +1,6 @@ +#autoload + +local words=3D("$words[@]") CURRENT=3D$CURRENT +words[1]=3D("$@") +(( CURRENT +=3D $# - 1 )) +_normal