@matheusbsbs / matheus-bagliano / commits / 7ae1e72762
Fork 0

git-gui: show command-line errors in a messagebox on Windows

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>

Pat Thoyts committed Oct 5, 2010 at 23:39 UTC 7ae1e727622883c029550e0b99488c6d058a94bc
1 file changed +16 -10
git-gui.sh
+16 -10
@@ -2863,7 +2863,8 @@ proc usage {} {
2863 set s "usage: $::argv0 $::subcommand $::subcommand_args"
2864 if {[tk windowingsystem] eq "win32"} {
2865 wm withdraw .
2866 - tk_messageBox -icon info -title "Usage" -message $s
2866 + tk_messageBox -icon info -message $s \
2867 + -title [mc "Usage"]
2868 } else {
2869 puts stderr $s
2870 }
@@ -2936,7 +2937,11 @@ blame {
2937 if {[catch {
2938 set head [git rev-parse --verify $head]
2939 } err]} {
2939 - puts stderr $err
2940 + if {[tk windowingsystem] eq "win32"} {
2941 + tk_messageBox -icon error -title [mc Error] -message $err
2942 + } else {
2943 + puts stderr $err
2944 + }
2945 exit 1
2946 }
2947 }
@@ -2975,18 +2980,19 @@ blame {
2980 citool -
2981 gui {
2982 if {[llength $argv] != 0} {
2978 - puts -nonewline stderr "usage: $argv0"
2979 - if {$subcommand ne {gui}
2980 - && [file tail $argv0] ne "git-$subcommand"} {
2981 - puts -nonewline stderr " $subcommand"
2982 - }
2983 - puts stderr {}
2984 - exit 1
2983 + usage
2984 }
2985 # fall through to setup UI for commits
2986 }
2987 default {
2989 - puts stderr "usage: $argv0 \[{blame|browser|citool}\]"
2988 + set err "usage: $argv0 \[{blame|browser|citool}\]"
2989 + if {[tk windowingsystem] eq "win32"} {
2990 + wm withdraw .
2991 + tk_messageBox -icon error -message $err \
2992 + -title [mc "Usage"]
2993 + } else {
2994 + puts stderr $err
2995 + }
2996 exit 1
2997 }
2998 }