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 <patthoyts@users.sourceforge.net>
Pat Thoyts committed
Aug 8, 2010 at 00:07 UTC
ea47503d4dc80db54dbb8e568f7a7058ec25bacb
1 file changed
+7
-1
git-gui.sh
+7
-1
@@ -2845,7 +2845,13 @@ bind all <$M1B-Key-W> {destroy [winfo toplevel %W]}
2845
2846
set subcommand_args {}
2847
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
+ }
2855
exit 1
2856
}
2857