Skip to content

Commit ea47503

Browse files
committed
git-gui: Make usage statement visible on Windows.
On Windows stdout and stderr are not connected to anything so the usage statement is never shown to the user when an error is made with a command line like 'git gui browser'. Use a messagebox on windows. Signed-off-by: Pat Thoyts <[email protected]>
1 parent 2810a58 commit ea47503

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

git-gui.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2845,7 +2845,13 @@ bind all <$M1B-Key-W> {destroy [winfo toplevel %W]}
28452845
28462846
set subcommand_args {}
28472847
proc usage {} {
2848-
puts stderr "usage: $::argv0 $::subcommand $::subcommand_args"
2848+
set s "usage: $::argv0 $::subcommand $::subcommand_args"
2849+
if {[tk windowingsystem] eq "win32"} {
2850+
wm withdraw .
2851+
tk_messageBox -icon info -title "Usage" -message $s
2852+
} else {
2853+
puts stderr $s
2854+
}
28492855
exit 1
28502856
}
28512857

0 commit comments

Comments
 (0)