1## vim:ft=zsh
2## Written by Frank Terbeck <ft@bewatermyfriend.org>
3## Distributed under the same BSD-ish license as zsh itself.
4
5emulate -L zsh
6setopt extendedglob
7
8if (( ${#argv} < 2 )); then
9    print 'usage: vcs_info_hookadd <HOOK> <FUNCTION(s)...>'
10    return 1
11fi
12
13local hook func context
14local -a old
15
16hook=$1
17shift
18context=":vcs_info-static_hooks:${hook}"
19
20zstyle -a "${context}" hooks old
21zstyle "${context}" hooks "${old[@]}" "$@"
22return $?
23