sub usage
{
+ my $exitcode = shift;
print << 'USAGE';
usage: git difftool [-t|--tool=<tool>]
[-x|--extcmd=<cmd>]
[--prompt] [-y|--no-prompt]
['git diff' options]
USAGE
- exit 1;
+ exit($exitcode);
}
sub setup_environment
'x|extcmd:s' => \$extcmd);
if (defined($help)) {
- usage();
+ usage(0);
}
if (defined($difftool_cmd)) {
if (length($difftool_cmd) > 0) {
$ENV{GIT_DIFF_TOOL} = $difftool_cmd;
} else {
print "No <tool> given for --tool=<tool>\n";
- usage();
+ usage(1);
}
}
if (defined($extcmd)) {
$ENV{GIT_DIFFTOOL_EXTCMD} = $extcmd;
} else {
print "No <cmd> given for --extcmd=<cmd>\n";
- usage();
+ usage(1);
}
}
if ($gui) {