Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/rofl0r/proxychains-ng.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFreed-Wu <wuzy01@qq.com>2022-03-30 09:16:06 +0300
committerrofl0r <rofl0r@users.noreply.github.com>2022-04-13 02:55:19 +0300
commit04023d3811d8ee34b498b429bac7a871045de59c (patch)
treed199b449dfb2629f8aab062ec46a061896a56d5c
parent0a4daa62d6d7889e630428325e08dfe8e83caf5e (diff)
Add zsh completion file
-rw-r--r--Makefile10
-rw-r--r--completions/_proxychains12
2 files changed, 20 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index b191bf6..dd75e13 100644
--- a/Makefile
+++ b/Makefile
@@ -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
diff --git a/completions/_proxychains b/completions/_proxychains
new file mode 100644
index 000000000..1fa399b
--- /dev/null
+++ b/completions/_proxychains
@@ -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 }'