Skip to content

Commit

Permalink
git-gui: Make usage statement visible on Windows.
Browse files Browse the repository at this point in the history
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 <patthoyts@users.sourceforge.net>
  • Loading branch information
Pat Thoyts committed Aug 7, 2010
1 parent 2810a58 commit ea47503
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion git-gui.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2845,7 +2845,13 @@ bind all <$M1B-Key-W> {destroy [winfo toplevel %W]}
set subcommand_args {}
proc usage {} {
puts stderr "usage: $::argv0 $::subcommand $::subcommand_args"
set s "usage: $::argv0 $::subcommand $::subcommand_args"
if {[tk windowingsystem] eq "win32"} {
wm withdraw .
tk_messageBox -icon info -title "Usage" -message $s
} else {
puts stderr $s
}
exit 1
}
Expand Down

0 comments on commit ea47503

Please sign in to comment.