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 typeset_silent
7
8local sys
9typeset -ga VCS_INFO_backends
10local -a match mbegin mend
11
12VCS_INFO_backends=()
13
14for file in ${^fpath}/VCS_INFO_get_data_*~*(\~|.zwc)(N) ; do
15    file=${file:t}
16    : ${file:#(#b)VCS_INFO_get_data_(*)}
17    sys=${match[1]}
18
19    [[ -n ${(M)VCS_INFO_backends:#${sys}} ]] && continue
20    VCS_INFO_backends+=(${sys})
21    autoload -Uz VCS_INFO_detect_${sys}
22    autoload -Uz VCS_INFO_get_data_${sys}
23done
24
25return 0
26