From 4cc0a2638c46cebda5bc6616fa3f94c720c5686d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A4ntz=20Miccoli?= Date: Mon, 16 Dec 2013 00:39:26 +0100 Subject: [PATCH] A paver (Python build and configuration utility) plugin --- plugins/paver/paver.plugin.zsh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 plugins/paver/paver.plugin.zsh diff --git a/plugins/paver/paver.plugin.zsh b/plugins/paver/paver.plugin.zsh new file mode 100644 index 000000000..40bdbd12f --- /dev/null +++ b/plugins/paver/paver.plugin.zsh @@ -0,0 +1,16 @@ +_paver_does_target_list_need_generating () { + [ ! -f .paver_targets ] && return 0; + [ pavement.py -nt .paver_targets ] && return 0; + return 1; +} + +_paver () { + if [ -f pavement.py ]; then + if _paver_does_target_list_need_generating; then + paver --help 2>&1 |grep '-'|grep -v -e '--'|awk -F '-' '{print $1}'|tr -d ' ' > .paver_targets + fi + compadd `cat .paver_targets` + fi +} + +compdef _paver paver