Page MenuHomeFreeBSD

D31463.id93421.diff
No OneTemporary

D31463.id93421.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,39 @@
+# Helper for programmable shell completions.
+#
+# Feature: completions
+# Usage: USES=completions OR USES=completions:ARGS
+# Valid ARGS: env
+#
+# env Exposes the shell completion variables only and does
+# not create the shell directories automatically.
+#
+# Variables for ports:
+#
+# 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
+
+. if empty(completions_ARGS)
+_USES_install+= 501:shell-directories
+shell-directories:
+ @${MKDIR} ${STAGEDIR}${BASH_COMPDIR} \
+ ${STAGEDIR}${FISH_COMPDIR} \
+ ${STAGEDIR}${ZSH_COMPDIR}
+. endif
+.endif

File Metadata

Mime Type
text/plain
Expires
Sun, Sep 13, 1:47 AM (14 h, 34 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
38828701
Default Alt Text
D31463.id93421.diff (1 KB)

Event Timeline