mirror of
https://github.com/jayphelps/git-blame-someone-else.git
synced 2025-05-01 19:16:21 +02:00
Merge pull request #5 from ryanmjacobs/master
Check for correct number of arguments.
This commit is contained in:
commit
07b4f92f3c
1 changed files with 6 additions and 1 deletions
|
@ -1,5 +1,10 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
if [ $# -ne 2 ]; then
|
||||
>&2 echo "Usage: $0 <author> <commit>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
AUTHOR=$1
|
||||
AUTHOR_NAME=$(echo $AUTHOR | perl -wlne '/^(.*)\s*<.*>$/ and print $1')
|
||||
AUTHOR_EMAIL=$(echo $AUTHOR | perl -wlne '/^.*\s*<(.*)>$/ and print $1')
|
||||
|
@ -11,4 +16,4 @@ COMMIT=$(git rev-parse --short $2)
|
|||
git rebase --continue
|
||||
} &> /dev/null
|
||||
|
||||
echo "$AUTHOR_NAME is now the author of $COMMIT. You're officially an asshole.";
|
||||
echo "$AUTHOR_NAME is now the author of $COMMIT. You're officially an asshole.";
|
||||
|
|
Loading…
Add table
Reference in a new issue