Makefile: Add completions

Signed-off-by: Morten Linderud <morten@linderud.pw>
This commit is contained in:
Morten Linderud 2021-09-05 14:41:59 +02:00
parent 66d1482dd9
commit 69e52d3efb
No known key found for this signature in database
GPG Key ID: E742683BA08CB2FF
1 changed files with 7 additions and 1 deletions

View File

@ -23,7 +23,13 @@ docs/sbctl.%: docs/sbctl.%.txt docs/asciidoc.conf
sbctl: $(SOURCES)
go build ./cmd/$@
install: man
.PHONY: completion
completion:
./sbctl completion bash | install -Dm644 /dev/stdin "$(DESTDIR)$(SHRDIR)/bash-completion/completions/sbctl"
./sbctl completion zsh | install -Dm644 /dev/stdin "$(DESTDIR)$(SHRDIR)/usr/share/zsh/site-functions/_sbctl"
./sbctl completion fish | install -Dm644 /dev/stdin "$(DESTDIR)$(SHRDIR)/usr/share/fish/vendor_completions.d/sbctl.fish"
install: man completion
install -Dm755 sbctl -t $(DESTDIR)$(BINDIR)
for manfile in $(MANS); do \
install -Dm644 $$manfile -t $(DESTDIR)$(MANDIR)/man$${manfile##*.}; \