Create and use $DATADIR/vendor_completions.d/ for upstream completions

Closes #1485.
This commit is contained in:
David Adam 2014-10-01 07:01:24 +08:00
parent 3616dd5889
commit 5157ac30fa
3 changed files with 4 additions and 3 deletions

View file

@ -621,6 +621,7 @@ install-force: all install-translations
$(INSTALL) -m 755 -d $(DESTDIR)$(sysconfdir)/fish
$(INSTALL) -m 755 -d $(DESTDIR)$(datadir)/fish
$(INSTALL) -m 755 -d $(DESTDIR)$(datadir)/fish/completions
$(INSTALL) -m 755 -d $(DESTDIR)$(datadir)/fish/vendor_completions.d
$(INSTALL) -m 755 -d $(DESTDIR)$(datadir)/fish/functions
$(INSTALL) -m 755 -d $(DESTDIR)$(datadir)/fish/man/man1
$(INSTALL) -m 755 -d $(DESTDIR)$(datadir)/fish/tools

View file

@ -377,9 +377,9 @@ Functions beginning with the string `__fish_print_` print a newline separated li
Completions can be defined on the commandline or in a configuration file, but they can also be automatically loaded. Fish automatically searches through any directories in the array variable `$fish_complete_path`, and any completions defined are automatically loaded when needed. A completion file must have a filename consisting of the name of the command to complete and the suffix '`.fish`'.
The default value for `$fish_complete_path` is `~/.config/fish/completions` `/etc/fish/completions` `/usr/share/fish/completions`. The exact path to the last two of these may be slightly different depending on what install path prefix was chosen at configuration time. If a suitable file is found in one of these directories, it will be automatically loaded and the search will be stopped. The rationale behind having three different directories is that the first one is for user specific completions, the second one is for system-wide completions and the last one is for default fish completions.
The default value for `$fish_complete_path` is `~/.config/fish/completions` `/etc/fish/completions` `/usr/share/fish/vendor_completions.d` `/usr/share/fish/completions` `~/.local/share/generated_completions`. (Some paths may be slightly different depending on where fish is installed). If a suitable file is found in one of these directories, it will be automatically loaded and the search will be stopped. The large number of directories searched may be confusing. It is to allow, respectively, user-specific completions, system-wide completions, completions installed by other packages, default completions that ship with fish, and finally, completions generated from manual pages. If you are unsure, put your completions in `~/.config/fish/completions`.
If you have written new completions for a common Unix command, please consider sharing your work by submitting it via the instructions in <a href="#more-help">Further help and development</a>.
If you have written new completions for a common Unix command, please consider sharing your work by submitting it via the instructions in <a href="#more-help">Further help and development</a>. If you are developing another program and would like to ship completions with your program, install them to `/usr/share/fish/vendor_completions.d`.
\section expand Parameter expansion (Globbing)

View file

@ -57,7 +57,7 @@ if not contains $__fish_datadir/functions $fish_function_path
end
if not set -q fish_complete_path
set fish_complete_path $configdir/fish/completions $__fish_sysconfdir/completions $__fish_datadir/completions $userdatadir/fish/generated_completions
set fish_complete_path $configdir/fish/completions $__fish_sysconfdir/completions $__fish_datadir/vendor_completions.d $__fish_datadir/completions $userdatadir/fish/generated_completions
end
if not contains $__fish_datadir/completions $fish_complete_path