Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: alias of completion
- X-seq: zsh-users 23193
- From: Peter Stephenson <p.stephenson@xxxxxxxxxxx>
- To: Pier Paolo Grassi <pierpaolog@xxxxxxxxx>, zsh-users@xxxxxxx
- Subject: Re: alias of completion
- Date: Fri, 02 Mar 2018 10:51:03 +0000
- Cms-type: 201P
- Dkim-filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20180302105107euoutp01fc5234cbafb107c91eb360e971573074~YFOmPo9hp1976819768euoutp01Y
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1519987867; bh=hH9sIGm9/4l+uiAKW+CxTfQNFETYtA1sP6U5upkf/FM=; h=Date:From:To:Subject:In-reply-to:References:From; b=tMSjmdMxtXr+R0Kmr7L6x+xr7/tBSn3K1NdNo3q72Ub/Os4z3USszajH6VJZaucRQ 14r0EwybgR/qDzEmvwYn8wUWa1UpfMZNhGlZh6Syh+UsVzHe0OBYSKCEHztv1HVPzC N9+i+Y32xRrAk9CMdF0u9MSp3Qo5xAPBzwios/No=
- In-reply-to: <CAP+y1xCmn1bDmajXY39N=TOgdRbjGLdGVMJrUPnpq_--6+3QFA@mail.gmail.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- Organization: SCSC
- References: <CGME20180302093415epcas3p3d273c63fafad455cca7fec4072aeaea1@epcas3p3.samsung.com> <CAP+y1xCmn1bDmajXY39N=TOgdRbjGLdGVMJrUPnpq_--6+3QFA@mail.gmail.com>
From: Peter Stephenson <p.stephenson@xxxxxxxxxxx>
To: Pier Paolo Grassi <pierpaolog@xxxxxxxxx>
Cc: zsh-users@xxxxxxx
Subject: Re: alias of completion
Date: Fri, 2 Mar 2018 10:47:34 +0000
X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-pc-linux-gnu)
Organization: SCSC
On Fri, 2 Mar 2018 10:31:57 +0100
Pier Paolo Grassi <pierpaolog@xxxxxxxxx> wrote:
> One thing I was never been able to accomplish though, is: what if I
> want a custom function, say:
>
> mydockerwrapper(){}
>
> behave, for completion's sake, like, let's say:
>
> docker ls
>
> so that if I try to complete after
>
> mydockerwrapper <TAB>
>
> I get the same suggestion that I would get after docker ls, and if I
> have
>
> mydockerwrapper xx <TAB>
>
> I get the same completion that I would get after docker ls xx, and
> so on.
You need a bit of help from the completion function in
question to do this. The feature in question is "services": I just
looked at the docker completion and it does support this.
You'll need to do something like
compdef _docker mydockerwrapper=docker_service_complete_ls_filters
where the thing on the right of the "=" is an appropriate docker
completion function without the "_" (search for _$service for the code
in _docker supporting this).
pws
Messages sorted by:
Reverse Date,
Date,
Thread,
Author