From e9ce2691c913004051c418f7457072df49ca2680 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Fri, 11 Nov 2022 20:33:07 +0100 Subject: Add ZSH completions --- Makefile | 16 +++++++++------- completions/_center | 11 +++++++++++ 2 files changed, 20 insertions(+), 7 deletions(-) create mode 100644 completions/_center diff --git a/Makefile b/Makefile index a27d0c8..c758d39 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,12 @@ .POSIX: -CFLAGS = -Wall -Wextra -Wpedantic -Werror \ - -O3 -march=native -mtune=native -fomit-frame-pointer \ - -pipe -D_POSIX_C_SOURCE=200809 -PREFIX = /usr -DPREFIX = ${DESTDIR}${PREFIX} -MANDIR = ${DPREFIX}/share/man +CFLAGS = -Wall -Wextra -Wpedantic -Werror \ + -O3 -march=native -mtune=native -fomit-frame-pointer \ + -pipe -D_POSIX_C_SOURCE=200809 +PREFIX = /usr +DPREFIX = ${DESTDIR}${PREFIX} +MANDIR = ${DPREFIX}/share/man +ZCOMPDIR = ${DPREFIX}/share/zsh/functions/Completion/Unix target = center @@ -16,6 +17,7 @@ clean: rm -f ${target} install: - mkdir -p ${DPREFIX}/bin ${MANDIR}/man1 + mkdir -p ${DPREFIX}/bin ${MANDIR}/man1 ${ZCOMPDIR} cp ${target} ${DPREFIX}/bin cp ${target}.1 ${MANDIR}/man1 + cp completions/_${target} ${ZCOMPDIR} diff --git a/completions/_center b/completions/_center new file mode 100644 index 0000000..504028e --- /dev/null +++ b/completions/_center @@ -0,0 +1,11 @@ +#compdef center + +_arguments -sS \ + '-e[do not consider ANSI color escape sequences]' \ + '-l[center files, not files]' \ + '-r[display tabs using spaces]' \ + '-t+[specify width of tab characters]:tab width (in columns)' \ + '-w+[specify output width]:output width (in columns)' \ + '*: :_files' + +# vi: ft=zsh -- cgit v1.2.3