Skip to content

Commit

Permalink
_xe: add zsh completion
Browse files Browse the repository at this point in the history
  • Loading branch information
leahneukirchen committed Nov 5, 2017
1 parent 36f3dd8 commit bceb8e0
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Makefile
@@ -1,11 +1,13 @@
ALL=xe
ZSHCOMP=_xe

CFLAGS=-g -O2 -Wall -Wno-switch -Wextra -Wwrite-strings

DESTDIR=
PREFIX=/usr/local
BINDIR=$(PREFIX)/bin
MANDIR=$(PREFIX)/share/man
ZSHCOMPDIR=$(PREFIX)/share/zsh/site-functions

all: $(ALL)

Expand 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 >$@
Expand Down
20 changes: 20 additions & 0 deletions _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'

0 comments on commit bceb8e0

Please sign in to comment.