aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile50
-rw-r--r--dist/archlinux/stable/PKGBUILD6
-rw-r--r--src/bfind.auto-completion17
3 files changed, 66 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index 98953ee..de78779 100644
--- a/Makefile
+++ b/Makefile
@@ -15,10 +15,10 @@ PY3_SHEBANG = /usr/bin/env python3
.PHONY: default
-default: cmd info
+default: cmd info shell
.PHONY: all
-all: cmd doc
+all: cmd doc shell
.PHONY: cmd
cmd: bin/bfind
@@ -62,13 +62,34 @@ bin/%.ps: doc/info/%.texinfo
cd obj/ps && texi2pdf --ps ../../"$<" < /dev/null
mv obj/ps/$*.ps $@
+.PHONY: shell
+shell: bash fish zsh
+
+.PHONY: bash
+bash: bin/bfind.bash-completion
+
+.PHONY: fish
+fish: bin/bfind.fish-completion
+
+.PHONY: zsh
+zsh: bin/bfind.zsh-completion
+
+obj/bfind.auto-completion: src/bfind.auto-completion
+ @mkdir -p obj
+ cp $< $@
+ sed -i 's/^(bfind$$/($(COMMAND)/' $@
+
+bin/bfind.%sh-completion: obj/bfind.auto-completion
+ @mkdir -p bin
+ auto-auto-complete $*sh --output $@ --source $<
+
.PHONY: install-default
-install-default: install-core install-info
+install-default: install-core install-info install-shell
.PHONY: install
-install: install-core install-doc
+install: install-core install-doc install-shell
.PHONY: install-core
install-core: install-cmd install-license
@@ -106,6 +127,24 @@ install-ps: bin/bfind.ps
install -dm755 -- "$(DESTDIR)$(DOCDIR)"
install -m644 $< -- "$(DESTDIR)$(DOCDIR)/$(PKGNAME).ps"
+.PHONY: install-shell
+install-shell: install-bash install-fish install-zsh
+
+.PHONY: install-bash
+install-bash: bin/bfind.bash-completion
+ install -dm755 -- "$(DESTDIR)$(DATADIR)/bash-completion/completions"
+ install -m644 $< -- "$(DESTDIR)$(DATADIR)/bash-completion/completions/$(COMMAND)"
+
+.PHONY: install-fish
+install-fish: bin/bfind.fish-completion
+ install -dm755 -- "$(DESTDIR)$(DATADIR)/fish/completions"
+ install -m644 $< -- "$(DESTDIR)$(DATADIR)/fish/completions/$(COMMAND).fish"
+
+.PHONY: install-zsh
+install-zsh: bin/bfind.zsh-completion
+ install -dm755 -- "$(DESTDIR)$(DATADIR)/zsh/site-functions"
+ install -m644 $< -- "$(DESTDIR)$(DATADIR)/zsh/site-functions/_$(COMMAND)"
+
.PHONY: uninstall
@@ -118,6 +157,9 @@ uninstall:
-rm -- "$(DESTDIR)$(DOCDIR)/$(PKGNAME).pdf"
-rm -- "$(DESTDIR)$(DOCDIR)/$(PKGNAME).dvi"
-rm -- "$(DESTDIR)$(DOCDIR)/$(PKGNAME).ps"
+ -rm -- "$(DESTDIR)$(DATADIR)/bash-completion/completions/$(COMMAND)"
+ -rm -- "$(DESTDIR)$(DATADIR)/fish/completions/$(COMMAND).fish"
+ -rm -- "$(DESTDIR)$(DATADIR)/zsh/site-functions/_$(COMMAND)"
diff --git a/dist/archlinux/stable/PKGBUILD b/dist/archlinux/stable/PKGBUILD
index 1f64a77..27ec5db 100644
--- a/dist/archlinux/stable/PKGBUILD
+++ b/dist/archlinux/stable/PKGBUILD
@@ -1,14 +1,14 @@
# Maintainer: Mattias Andrée <`base64 -d`(bWFhbmRyZWUK)@member.fsf.org>
pkgname=bfind
-pkgver=2
-pkgrel=2
+pkgver=2.1
+pkgrel=1
pkgdesc="find alternative optimised for finding files rather then listing files"
url="https://github.com/maandree/bfind"
arch=(any)
license=(GPL3)
depends=(python3)
-makedepends=(make coreutils sed texinfo gzip)
+makedepends=(make coreutils sed texinfo gzip auto-auto-complete)
install=bfind.install
source=("${url}/archive/${pkgver}.tar.gz")
sha256sums=(54ffd0439d9f9f4579bed39aeaaa72d54f4a270e8961cbc07b67895e96a42cfd)
diff --git a/src/bfind.auto-completion b/src/bfind.auto-completion
new file mode 100644
index 0000000..f1f74e2
--- /dev/null
+++ b/src/bfind.auto-completion
@@ -0,0 +1,17 @@
+(bfind
+ (unargumented (options -x --xdev) (complete --xdev)
+ (desc 'Do not crawl across mount points'))
+
+ (unargumented (options -h --hardlinks) (complete --hardlinks)
+ (desc 'Be aware of hardlinked directories'))
+
+ (unargumented (options -s --symlinks) (complete --symlinks)
+ (desc 'Crawl symbolically linked directories, but never visit more than once'))
+
+ (unargumented (options -v --visible) (complete --visible)
+ (desc 'Do not list files starting with a dot'))
+
+ (unargumented (options -0 --print0) (complete --print0)
+ (desc 'Terminate lines with NUL instead of LF'))
+)
+