aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2024-01-12 17:46:04 +0300
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2024-01-12 17:46:04 +0300
commit62e09984bf054e96cedb7eefaf0f59b35b270c07 (patch)
treeda322fab9ad72d4e02c4c8d95bd2b9e9d8e9afe6 /Makefile
parent0fbed9a95255c9a6ade511bf3c12286f4450fa90 (diff)
downloadopenrussian-cli-62e09984bf054e96cedb7eefaf0f59b35b270c07.tar.gz
added support for Zsh autocompletions
* actually autocompletions are much more powerful than on Bash
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile12
1 files changed, 10 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 8d51ea3..f0bfb1b 100644
--- a/Makefile
+++ b/Makefile
@@ -3,7 +3,8 @@ PREFIX ?= /usr/local
LUA ?= lua5.2
LUAC ?= luac5.2
-COMPLETIONSDIR ?= $(shell pkg-config --variable=completionsdir bash-completion)
+BASH_COMPLETIONSDIR ?= $(shell pkg-config --variable=completionsdir bash-completion)
+ZSH_COMPLETIONSDIR ?= $(PREFIX)/share/zsh/site-functions
all : openrussian openrussian-sqlite3.db
@@ -44,7 +45,14 @@ install : openrussian openrussian-sqlite3.db \
install openrussian $(DESTDIR)$(PREFIX)/bin
mkdir -p $(DESTDIR)$(PREFIX)/share/openrussian
cp openrussian-sqlite3.db $(DESTDIR)$(PREFIX)/share/openrussian
- cp openrussian-completion.bash $(DESTDIR)$(COMPLETIONSDIR)/openrussian
+ifneq ($(BASH_COMPLETIONSDIR),)
+ mkdir -p $(DESTDIR)$(BASH_COMPLETIONSDIR)
+ cp openrussian-completion.bash $(DESTDIR)$(BASH_COMPLETIONSDIR)/openrussian
+endif
+ifneq ($(ZSH_COMPLETIONSDIR),)
+ mkdir -p $(DESTDIR)$(ZSH_COMPLETIONSDIR)
+ cp openrussian-completion.zsh $(DESTDIR)$(ZSH_COMPLETIONSDIR)/_openrussian
+endif
mkdir -p $(DESTDIR)$(PREFIX)/man/man1
cp openrussian.1 $(DESTDIR)$(PREFIX)/man/man1
mandb || true