Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: How does a new software package provide Zsh tab completion scripts to users?
- X-seq: zsh-users 17763
- From: Phil Pennock <zsh-workers+phil.pennock@xxxxxxxxxxxx>
- To: Robert McLay <mclay@xxxxxxxxxxxxxxx>
- Subject: Re: How does a new software package provide Zsh tab completion scripts to users?
- Date: Tue, 23 Apr 2013 18:15:25 -0400
- Cc: zsh-users@xxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=spodhuis.org; s=d201210; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=6dS4lQ4euwgY+XH8b8fSA0L38DTd3V9oDa5RIaHkwo8=; b=UAWc+pardng07FMWQPxQyIQmQRBy+UUU6NqKHWiB0PFtlqmdEWOqKlmoxpQZ3yWhUpxz6fpa0AHLztCyWTuFAIUJI35JmF7SEtOXTFUEgkC9HR5cLMFgl0vbXx/oeFsHcWRtd/ozVPnFraF2BMvydJvbgMk2iKufY3h/cANWZcw=;
- In-reply-to: <CAAH8Jevr7tJj1RzzFupRSsUach-cnzCe3kVbd+6zLsA_TD=dLQ@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>
- Mail-followup-to: Robert McLay <mclay@xxxxxxxxxxxxxxx>, zsh-users@xxxxxxx
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CAAH8Jevr7tJj1RzzFupRSsUach-cnzCe3kVbd+6zLsA_TD=dLQ@mail.gmail.com>
On 2013-04-23 at 16:21 -0500, Robert McLay wrote:
> I am the author of a software package and I'd like to provide Zsh tab
> completion scripts for users of my package.
Option 1: get added to zsh
Upsides:
* always available
Downsides:
* only available by default with new versions
* decoupled from the version actually installed
Summary:
* works best when API is stable and you're able/willing to let
others handle maintenance
For the rest of this, I'll assume you don't want to just supply the
completion for inclusion with zsh, but it's probably still the best
option for you.
What should typically happen is that the OS build of zsh uses
`./configure --site-fndir=...` to supply some directory which collects
packages/other scripts, which will result in the default $FPATH/$fpath
in zsh having an extra directory to check.
Option 2: include in a contrib/ or misc/ directory, document
Upsides:
* You maintain complete control
* Can vary incompatibly
Downsides:
* Needs you to communicate clearly to packagers that there's a file
they should drop into the zsh site function directory (perhaps via
symlink)
* You need to figure out how far back in zsh terms you want to be
compatible and write portable zsh; for common features, this
shouldn't be an issue, but it's worth remembering that you can't
just use whatever facilities are added to make life easier for
you, whereas those who get the functions added to zsh can
Eg, on FreeBSD, the portupgrade tool just unilaterally installs the file
share/zsh/site-functions/_pkgtools (relative to the install-base) and if
zsh is installed, before or after, then the extra completions just
become available.
Option 3: user installation, no control of zsh or system install
Upsides:
* no coordination with anyone but user
Downsides:
* coordination with end users
Tell people to link to the file inside an element of $fpath which they
control and to do so before starting completion configuration. Tell
them that this won't be necessary with appropriate system configuration,
link to the document explaining how to get the completion set up in
system directories, let the users buy the sysadmins beer until the local
installs are fixed.
A little more seriously: there's a decision tree:
1: Does user admin their own system?
1=Yes:
2: Is user an experienced Unix user?
2=No: User should be using package management (option 2)
2=Yes: User should be using package management (option 2)
but they have a fallback to option 3
1=No:
3: Are there sysadmins?
3=Yes: Option 2 applies, the persuasion mentioned above
3=No: give up, they're doomed
Messages sorted by:
Reverse Date,
Date,
Thread,
Author