Skip to content

Commit 197bcf9

Browse files
committed
Verify that user supplied a command for --extcmd
If the user executed "git diffall --extcmd", it would result in a shift error with no useful message to the user. The script now verifies that a command was specified after --extcmd if it is the last option on the command-line. If it fails, an error message and usage instructions are displayed. Signed-off-by: Tim Henigan <tim.henigan@gmail.com>
1 parent bc77ff9 commit 197bcf9

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

git-diffall

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,14 @@ do
7676
copy_back=1
7777
;;
7878
-x|--e|--ex|--ext|--extc|--extcm|--extcmd)
79-
diff_tool=$2
80-
shift
79+
if test -z $2
80+
then
81+
echo You must specify the tool for use with --extcmd
82+
usage
83+
else
84+
diff_tool=$2
85+
shift
86+
fi
8187
;;
8288
--)
8389
path_sep=1

0 commit comments

Comments
 (0)