提交 fc865468 编写于 作者: L Linus Torvalds

Make 'git' script be a bit more helpful on unrecognized commands

上级 96069cf0
#!/bin/sh
cmd="git-$1-script"
cmd="$1"
shift
exec $cmd "$@"
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
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册