diff options
author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-14 11:01:49 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-14 11:01:49 -0700 |
commit | fc865468d88d45e76e21a9db2445a4b970f7423b (patch) | |
tree | 03a0b1c4ade23ce4b69944f3a0b47784075564e4 /git | |
parent | 96069cf03aca672e93d862813f2e7f05c1c7ac72 (diff) | |
download | git-fc865468d88d45e76e21a9db2445a4b970f7423b.tar.gz git-fc865468d88d45e76e21a9db2445a4b970f7423b.tar.xz |
Make 'git' script be a bit more helpful on unrecognized commands
Diffstat (limited to 'git')
-rwxr-xr-x | git | 19 |
1 files changed, 17 insertions, 2 deletions
@@ -1,4 +1,19 @@ #!/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 |