mirror of
https://github.com/git/git
synced 2024-08-27 03:29:21 +00:00
Make 'git' script be a bit more helpful on unrecognized commands
This commit is contained in:
parent
96069cf03a
commit
fc865468d8
19
git
19
git
|
@ -1,4 +1,19 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
cmd="git-$1-script"
|
cmd="$1"
|
||||||
shift
|
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
|
||||||
|
|
Loading…
Reference in a new issue