From bceb8e0ceb9778801e8e4b579f0f53e7feadfd2b Mon Sep 17 00:00:00 2001 From: Leah Neukirchen Date: Sun, 5 Nov 2017 01:09:26 +0100 Subject: _xe: add zsh completion --- Makefile | 5 ++++- _xe | 20 ++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 _xe diff --git a/Makefile b/Makefile index 32f481d..a511749 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,5 @@ ALL=xe +ZSHCOMP=_xe CFLAGS=-g -O2 -Wall -Wno-switch -Wextra -Wwrite-strings @@ -6,6 +7,7 @@ DESTDIR= PREFIX=/usr/local BINDIR=$(PREFIX)/bin MANDIR=$(PREFIX)/share/man +ZSHCOMPDIR=$(PREFIX)/share/zsh/site-functions all: $(ALL) @@ -16,9 +18,10 @@ check: FRC all prove -v install: FRC all - mkdir -p $(DESTDIR)$(BINDIR) $(DESTDIR)$(MANDIR)/man1 + mkdir -p $(DESTDIR)$(BINDIR) $(DESTDIR)$(MANDIR)/man1 $(DESTDIR)$(ZSHCOMPDIR) install -m0755 $(ALL) $(DESTDIR)$(BINDIR) install -m0644 $(ALL:=.1) $(DESTDIR)$(MANDIR)/man1 + install -m0644 $(ZSHCOMP) $(DESTDIR)$(ZSHCOMPDIR) README: xe.1 mandoc -Tutf8 $< | col -bx >$@ diff --git a/_xe b/_xe new file mode 100644 index 0000000..71dcfcc --- /dev/null +++ b/_xe @@ -0,0 +1,20 @@ +#compdef xe + +_arguments -s -S -A '-*' : \ + '-f[read argument from file]:file:_files' \ + '-s[use shell]:script: ' \ + '-a[use arguments after --]' \ + '-A[use arguments after separator]:separator: ' \ + '-0[read arguments NUL-separated]' \ + '-F[fatal: stop when a command fails]' \ + '*-L[line-buffer output]' \ + '-R[return 122 when no arguments are specified]' \ + '-n[dry run (do not run commands)]' \ + '-q[quiet mode]' \ + '*-v[verbose mode]' \ + '-I[argument replacement string]:string: ' \ + '-j[maximum number of parallel command executions]:number: ' \ + '(-p)-N[maximum number of arguments per command]:number: ' \ + '(-N)-p[enable percent rules]:percent pattern: ' \ + '(-):command name: _command_names -e' \ + '*::arguments:_normal' -- cgit 1.4.1