Zsh Mailing List Archive
Messages sorted by:
Re: Using the same completion function for various commands
- X-seq: zsh-workers 28500
- From: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- To: Zsh workers <zsh-workers@xxxxxxx>
- Subject: Re: Using the same completion function for various commands
- Date: Tue, 07 Dec 2010 15:51:54 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s1024; t=1291733515; bh=pXbLnUdVwI0Rctz/bojjmle8fmbJLugVC9Rio78bVB8=; h=X-Yahoo-Newman-Id:Received:X-Yahoo-SMTP:X-YMail-OSG:X-Yahoo-Newman-Property:Received:In-reply-to:From:References:To:Subject:MIME-Version:Content-Type:Content-ID:Date:Message-ID; b=Y08sM36nuRSQL9i6rZtJJ/z3l85r+d3vI9RG7oj+Nkl9DOI0lMEjm2aSmQBb89gOrcEbbrZf+GDHJtj4ioPF9VCLKTy3Xvp0TzT37I/Jp16Zph6u20eqAeQTJZaxeN6BZs7Ly2m/2QIi3ex/bRT+UgObI1U7eOstORfv49qQaFw=
- In-reply-to: <20101207115222.34859d66@xxxxxxxxxxxxxxxxxxxxxxxxx>
- List-help: <mailto:email@example.com>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:firstname.lastname@example.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <201012061512.21791.mrichter@xxxxxxxxxxxxxxxxxxxxxxxx> <AANLkTimY=rEETn1uOdkDJ33kGE=YUDAvevsBvvvMU7YL@xxxxxxxxxxxxxx> <AANLkTim1Ac1-VOkRQ1NXn_qL6-EV06bagVkK7y_UThwB@xxxxxxxxxxxxxx> <AANLkTin+NCoBRzx90fo+s0z7urCCoTA6T3cXTYdt_VD2@xxxxxxxxxxxxxx> <20101206151124.389fd287@xxxxxxxxxxxxxxxxxxxxxxxxx> <AANLkTin8Kn88NXsK4V4Toos0-ZB2hj4RvhX5QxLarq1N@xxxxxxxxxxxxxx> <15197.1291664361@thecus> <20101207115222.34859d66@xxxxxxxxxxxxxxxxxxxxxxxxx>
Peter Stephenson wrote:
> It looks like you can't in general distinguish between two ways of using
> the service:
I don't think $service was ever intended to be usable as a command name.
The change also now assumes that the command is in your path which often
it isn't. It's also common to use /usr/gnu/bin/du and expect it to use
the GNU completions. Someone writing obscure wrappers can sooner be
expected to know what they're doing that someone specifying commands
with a full path.
> In the first case you have the simple alternative of defining
> #compdef gdu
> _du "$@"
> which fixes the service for you.
And in the second case you have the simple alternative of using zstyle.
I've got tens of these and am not too keen on creating functions. And
why break backward compatibility?
Messages sorted by: