From abe0ee3936c7f4a291666af3a9d70ed2a6d710f4 Mon Sep 17 00:00:00 2001 From: Frank Terbeck Date: Wed, 30 Mar 2011 21:17:07 +0000 Subject: 28960: Add functions to add/remove static hooks. --- Functions/VCS_Info/vcs_info_hookadd | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Functions/VCS_Info/vcs_info_hookadd (limited to 'Functions/VCS_Info/vcs_info_hookadd') diff --git a/Functions/VCS_Info/vcs_info_hookadd b/Functions/VCS_Info/vcs_info_hookadd new file mode 100644 index 000000000..867f7e271 --- /dev/null +++ b/Functions/VCS_Info/vcs_info_hookadd @@ -0,0 +1,22 @@ +## vim:ft=zsh +## Written by Frank Terbeck +## Distributed under the same BSD-ish license as zsh itself. + +emulate -L zsh +setopt extendedglob + +if (( ${#argv} < 2 )); then + print 'usage: vcs_info_hookadd ' + return 1 +fi + +local hook func context +local -a old + +hook=$1 +shift +context=":vcs_info-static_hooks:${hook}" + +zstyle -a "${context}" hooks old +zstyle "${context}" hooks "${old[@]}" "$@" +return $? -- cgit 1.4.1