1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-06-10 07:36:10 +02:00
git/git

20 lines
415 B
Bash
Executable File

#!/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