difftool: add a -y shortcut for --no-prompt
[gitweb.git] / contrib / difftool / git-difftool
index 207dd50f2ca4ca328b7233f80b7c350277bc547b..8c160e5bb4a01319eb1257141813c03b54a3e758 100755 (executable)
@@ -18,7 +18,7 @@ my $DIR = abs_path(dirname($0));
 sub usage
 {
        print << 'USAGE';
-usage: git difftool [--tool=<tool>] [--no-prompt] ["git diff" options]
+usage: git difftool [--tool=<tool>] [-y|--no-prompt] ["git diff" options]
 USAGE
        exit 1;
 }
@@ -60,11 +60,11 @@ sub generate_command
                        $ENV{GIT_DIFF_TOOL} = substr($arg, 7);
                        next;
                }
-               if ($arg eq '--no-prompt') {
+               if ($arg eq '-y' || $arg eq '--no-prompt') {
                        $ENV{GIT_DIFFTOOL_NO_PROMPT} = 'true';
                        next;
                }
-               if ($arg eq '-h' or $arg eq '--help') {
+               if ($arg eq '-h' || $arg eq '--help') {
                        usage();
                }
                push @command, $arg;