From: Pier Paolo Grassi <pierpaolog@gmail.com>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: Zsh-Users List <zsh-users@zsh.org>
Subject: Re: complete as some other sub command
Date: Tue, 5 Nov 2024 12:57:55 +0100 [thread overview]
Message-ID: <CAP+y1xCpN1HCBm+ntM1XCbktryina5sN6Q2OtucaSFPxTKGhag@mail.gmail.com> (raw)
In-Reply-To: <CAH+w=7ZfHfW3hoTuWuP=s4gwXd1Ydx7TVSWatNfjUHVYQ3uYHw@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 824 bytes --]
that worked, thanks
Pier Paolo Grassi
Il giorno lun 4 nov 2024 alle ore 18:15 Bart Schaefer <
schaefer@brasslantern.com> ha scritto:
> On Mon, Nov 4, 2024 at 8:59 AM Peter Stephenson
> <p.w.stephenson@ntlworld.com> 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_if
> new file mode 100644
> index 000000000..84777ee32
> --- /dev/null
> +++ b/Completion/Base/Utility/_as_if
> @@ -0,0 +1,6 @@
> +#autoload
> +
> +local words=("$words[@]") CURRENT=$CURRENT
> +words[1]=("$@")
> +(( CURRENT += $# - 1 ))
> +_normal
>
>
[-- Attachment #2: Type: text/html, Size: 1477 bytes --]
prev parent reply other threads:[~2024-11-05 11:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-04 16:42 Pier Paolo Grassi
2024-11-04 16:59 ` Peter Stephenson
2024-11-04 17:14 ` Bart Schaefer
2024-11-05 11:57 ` Pier Paolo Grassi [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAP+y1xCpN1HCBm+ntM1XCbktryina5sN6Q2OtucaSFPxTKGhag@mail.gmail.com \
--to=pierpaolog@gmail.com \
--cc=schaefer@brasslantern.com \
--cc=zsh-users@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).