Permalink
Browse files

Implemented zsh completion definition

  • Loading branch information...
mtorromeo committed Sep 6, 2011
1 parent f99a7d9 commit fe417c21e5a9376516bed942fdf7c3191b1f6efd
Showing with 27 additions and 1 deletion.
  1. +3 −1 Makefile
  2. +24 −0 zsh_completion
View
@@ -22,7 +22,7 @@ burp.1: README.pod
dist: clean
mkdir -p burp-${VERSION}
- cp -R ${SRC} *.h README.pod bash_completion burp-${VERSION}
+ cp -R ${SRC} *.h README.pod bash_completion zsh_completion burp-${VERSION}
sed "s/^VERSION *.*/VERSION = ${VERSION}/" < Makefile > burp-${VERSION}/Makefile
tar -czf burp-${VERSION}.tar.gz burp-${VERSION}
${RM} -r burp-${VERSION}
@@ -36,12 +36,14 @@ strip: burp
install: burp doc
install -Dm755 burp ${DESTDIR}${PREFIX}/bin/burp
install -Dm644 bash_completion ${DESTDIR}/etc/bash_completion.d/burp
+ install -Dm644 zsh_completion ${DESTDIR}/usr/share/zsh/site-functions/_burp
install -Dm644 burp.1 ${DESTDIR}${PREFIX}/share/man/man1/burp.1
uninstall:
${RM} ${DESTDIR}${PREFIX}/bin/burp
${RM} ${DESTDIR}${MANPREFIX}/man1/burp.1
${RM} ${DESTDIR}/etc/bash_completion.d/burp
+ ${RM} ${DESTDIR}/usr/share/zsh/site-functions/_burp
.PHONY: all doc clean install uninstall
View
@@ -0,0 +1,24 @@
+#compdef burp
+
+_categories() {
+ burp -c help | head -n -1 | tail -n +2 | while read CAT; do
+ _wanted "AUR categories" expl "AUR categories" compadd -- $CAT
+ done
+}
+
+_burp() {
+ local context state line expl
+ local -A opt_args
+
+ _arguments \
+ "(-h --help)"{-h,--help}"[Show help]" \
+ "(-u --user)"{-u,--user}"[AUR login username]:USER:" \
+ "(-p --password)"{-p,--password}"[AUR login password]:PASSWORD:" \
+ "(-c --cat)"{-c,--cat}"[Assign the uploaded package with category CAT]:CATEGORY:_categories" \
+ "(-C --cookies)"{-C,--cookies}"[Use FILE to store cookies rather than the default temporary file]:FILE:_files" \
+ "(-k --keep-cookies)"{-k,--keep-cookies}"[Cookies will be persistent and reused for logins]" \
+ "(-v --verbose)"{-v,--verbose}"[Be more verbose. Pass twice for debug info.]" \
+ ":targets:_files -g \*.src.tar.\*"
+}
+
+_burp "$@"

0 comments on commit fe417c2

Please sign in to comment.