aboutsummaryrefslogtreecommitdiff
path: root/git
blob: 9f511956ae1dd2dcfef3e2c16e13f6ba6f69175f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh
cmd="$1"
shift
if which git-$cmd-script >& /dev/null
then
	exec git-$cmd-script "$@"
fi

if which git-$cmd >& /dev/null
then
	exec git-$cmd "$@"
fi

alternatives=($(echo $PATH | tr ':' '\n' | while read i; do ls $i/git-*-script 2> /dev/null; done))

echo Git command "'$cmd'" not found. Try one of
for i in "${alternatives[@]}"; do
	echo $i | sed 's:^.*/git-:   :' | sed 's:-script$::'
done | sort | uniq