From 9845cec65305ad2c7d69356e118fc94507e4e99e Mon Sep 17 00:00:00 2001 From: ckath Date: Sun, 29 Sep 2019 01:41:31 +0200 Subject: [PATCH 1/4] zsh completions --- _fuf | 18 ++++++++++++++++++ makefile | 1 + 2 files changed, 19 insertions(+) create mode 100644 _fuf diff --git a/_fuf b/_fuf new file mode 100644 index 0000000..027a5cd --- /dev/null +++ b/_fuf @@ -0,0 +1,18 @@ +#compdef fuf +# +# Completion definition for fuf. + +setopt localoptions noshwordsplit noksharrays +local -a args +args=( + '(-a)-a[sort alphabetical, this is default]' + '(-A)-A[sort alphabetical, reversed]' + '(-s)-s[sort by size]' + '(-S)-S[sort by size, reversed]' + '(-t)-t[sort by time]' + '(-T)-T[sort by time, reversed]' + '(-v)-v[version info]' + '(-h)-h[usage info]' + '*:filename:_files' +) +_arguments -S -s $args diff --git a/makefile b/makefile index 70a5e0f..dfbfb0b 100644 --- a/makefile +++ b/makefile @@ -27,6 +27,7 @@ install: ${NAME} @echo installing scripts @mkdir -p ${DESTDIR}/lib/${NAME} @cp -f scripts/* ${DESTDIR}/lib/${NAME} + @cp -f _${NAME} ${DESTDIR}/share/zsh/site-functions/ uninstall: ${NAME} @echo removing executable file from ${DESTDIR}/bin @rm -f ${DESTDIR}/bin/${NAME} From 57a49dc25e405521102b18e2a08c4acf9f4e0c26 Mon Sep 17 00:00:00 2001 From: ckath Date: Fri, 11 Oct 2019 20:47:32 +0200 Subject: [PATCH 2/4] move completions to seperate dir --- _fuf => completions/zsh/_fuf | 0 makefile | 3 ++- 2 files changed, 2 insertions(+), 1 deletion(-) rename _fuf => completions/zsh/_fuf (100%) diff --git a/_fuf b/completions/zsh/_fuf similarity index 100% rename from _fuf rename to completions/zsh/_fuf diff --git a/makefile b/makefile index dfbfb0b..2b81285 100644 --- a/makefile +++ b/makefile @@ -27,9 +27,10 @@ install: ${NAME} @echo installing scripts @mkdir -p ${DESTDIR}/lib/${NAME} @cp -f scripts/* ${DESTDIR}/lib/${NAME} - @cp -f _${NAME} ${DESTDIR}/share/zsh/site-functions/ + @cp -f completions/zsh/_${NAME} ${DESTDIR}/share/zsh/site-functions/ uninstall: ${NAME} @echo removing executable file from ${DESTDIR}/bin @rm -f ${DESTDIR}/bin/${NAME} @echo removing scripts @rm -rf ${DESTDIR}/lib/${NAME} + @rm ${DESTDIR}/share/zsh/site-funcitons/_${NAME} From 9e7f8a00d60363eb42dc6f03ed3f884e1800eb08 Mon Sep 17 00:00:00 2001 From: ckath Date: Fri, 11 Oct 2019 21:12:23 +0200 Subject: [PATCH 3/4] add bash completion --- completions/bash/fuf | 1 + makefile | 2 ++ 2 files changed, 3 insertions(+) create mode 100644 completions/bash/fuf diff --git a/completions/bash/fuf b/completions/bash/fuf new file mode 100644 index 0000000..8307ea8 --- /dev/null +++ b/completions/bash/fuf @@ -0,0 +1 @@ +complete -W "-a -A -s -S -t -T -v -h" -o dirnames fuf diff --git a/makefile b/makefile index 2b81285..38d24dd 100644 --- a/makefile +++ b/makefile @@ -28,9 +28,11 @@ install: ${NAME} @mkdir -p ${DESTDIR}/lib/${NAME} @cp -f scripts/* ${DESTDIR}/lib/${NAME} @cp -f completions/zsh/_${NAME} ${DESTDIR}/share/zsh/site-functions/ + @cp -f completions/bash/${NAME} ${DESTDIR}/share/bash-completion/completions/ uninstall: ${NAME} @echo removing executable file from ${DESTDIR}/bin @rm -f ${DESTDIR}/bin/${NAME} @echo removing scripts @rm -rf ${DESTDIR}/lib/${NAME} @rm ${DESTDIR}/share/zsh/site-funcitons/_${NAME} + @rm ${DESTDIR}/share/bash/bash-completions/completions/${NAME} From ac38233ea004233d2ba3ee54fb34427c4355af85 Mon Sep 17 00:00:00 2001 From: ckath Date: Fri, 11 Oct 2019 21:15:16 +0200 Subject: [PATCH 4/4] correct typos for completion paths --- makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/makefile b/makefile index 38d24dd..4eb8e51 100644 --- a/makefile +++ b/makefile @@ -34,5 +34,5 @@ uninstall: ${NAME} @rm -f ${DESTDIR}/bin/${NAME} @echo removing scripts @rm -rf ${DESTDIR}/lib/${NAME} - @rm ${DESTDIR}/share/zsh/site-funcitons/_${NAME} - @rm ${DESTDIR}/share/bash/bash-completions/completions/${NAME} + @rm ${DESTDIR}/share/zsh/site-functions/_${NAME} + @rm ${DESTDIR}/share/bash-completion/completions/${NAME}