Add zsh completion file

pull/447/head
Freed-Wu 2022-03-30 14:16:06 +08:00 committed by rofl0r
parent 0a4daa62d6
commit 04023d3811
2 changed files with 20 additions and 2 deletions

View File

@ -11,7 +11,8 @@ bindir = $(exec_prefix)/bin
prefix = /usr/local/
includedir = $(prefix)/include
libdir = $(prefix)/lib
sysconfdir=$(prefix)/etc
sysconfdir = $(prefix)/etc
zshcompletiondir = $(prefix)/share/zsh/site_functions
OBJS = src/common.o src/main.o
@ -48,6 +49,7 @@ PXCHAINS = proxychains4
PXCHAINS_D = proxychains4-daemon
ALL_TOOLS = $(PXCHAINS) $(PXCHAINS_D)
ALL_CONFIGS = src/proxychains.conf
ZSH_COMPLETION = completions/_proxychains
-include config.mak
@ -68,9 +70,13 @@ $(DESTDIR)$(libdir)/%: %
$(DESTDIR)$(sysconfdir)/%: src/%
$(INSTALL) -D -m 644 $< $@
$(DESTDIR)$(zshcompletiondir)/%: completions/%
$(INSTALL) -D -m 644 $< $@
install-libs: $(ALL_LIBS:%=$(DESTDIR)$(libdir)/%)
install-tools: $(ALL_TOOLS:%=$(DESTDIR)$(bindir)/%)
install-config: $(ALL_CONFIGS:src/%=$(DESTDIR)$(sysconfdir)/%)
install-zsh-completion: $(ZSH_COMPLETION:completions/%=$(DESTDIR)$(zshcompletiondir)/%)
clean:
rm -f $(ALL_LIBS)
@ -97,4 +103,4 @@ $(PXCHAINS_D): $(DOBJS)
$(CC) $^ $(USER_LDFLAGS) -o $@
.PHONY: all clean install install-config install-libs install-tools
.PHONY: all clean install install-config install-libs install-tools install-zsh-completion

12
completions/_proxychains Normal file
View File

@ -0,0 +1,12 @@
#compdef proxychains
setopt localoptions extended_glob
local -a _comp_priv_prefix
_arguments \
'(- *)--help[More help in README file]' \
'(-q)-q[makes proxychains quiet - this overrides the config setting]' \
'(-f)-f[allows one to manually specify a configfile to use]:filename:_files' \
'(-)1:command: _command_names -e' \
'*::arguments:{ _comp_priv_prefix=( '$words[1]' -n ${(kv)opt_args[(I)(-[ugHEP]|--(user|group|set-home|preserve-env|preserve-groups))]} ) ; _normal }'