Page MenuHomeFreeBSD

D31463.id93989.diff
No OneTemporary

D31463.id93989.diff

diff --git a/Mk/Uses/completions.mk b/Mk/Uses/completions.mk
new file mode 100644
--- /dev/null
+++ b/Mk/Uses/completions.mk
@@ -0,0 +1,44 @@
+# Helper for programmable shell completions.
+#
+# Feature: completions
+# Usage: USES=completions OR USES=completions:ARGS
+# Valid ARGS: (none), env
+#
+# none Create the preliminary shell completion directories
+# and expose the port variables.
+# env Expose the port variables only.
+#
+# Variables, which can be used by the port:
+#
+# BASH_COMPDIR Path to the bash completion directory.
+# FISH_COMPDIR Path to the fish completion directory.
+# ZSH_COMPDIR Path to the zsh completion directory.
+#
+# MAINTAINER: ports@FreeBSD.org
+
+.if !defined(_INCLUDE_USES_COMPLETIONS_MK)
+_INCLUDE_USES_COMPLETIONS_MK= yes
+
+_valid_ARGS= env
+. for _arg in ${completions_ARGS}
+. if !${_valid_ARGS:M${_arg}}
+IGNORE= USES=completions: invalid argument: ${_arg}
+. endif
+. endfor
+
+BASH_COMPDIR?= ${PREFIX}/share/bash-completion/completions
+FISH_COMPDIR?= ${PREFIX}/share/fish/vendor_completions.d
+ZSH_COMPDIR?= ${PREFIX}/share/zsh/site-functions
+
+_SHELLS= BASH FISH ZSH
+. for shell in ${_SHELLS}
+PLIST_SUB+= ${shell}_COMPDIR=${${shell}_COMPDIR:S,^${PREFIX}/,,}
+. endfor
+. if empty(completions_ARGS)
+_USES_install+= 480:shell-directories
+shell-directories:
+. for shells in ${_SHELLS}
+ @${MKDIR} ${STAGEDIR}${${shell}_COMPDIR}
+. endfor
+. endif
+.endif

File Metadata

Mime Type
text/plain
Expires
Mon, Sep 14, 8:39 AM (16 h, 45 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
38897658
Default Alt Text
D31463.id93989.diff (1 KB)

Event Timeline