diff --git a/git-gui--askyesno b/git-gui--askyesno index f7312c70c2..d0c801c42c 100755 --- a/git-gui--askyesno +++ b/git-gui--askyesno @@ -5,6 +5,10 @@ exec wish "$0" -- "$@" # This is an implementation of a simple yes no dialog # which is injected into the git commandline by git gui # in case a yesno question needs to be answered. +# +# The window title, which defaults to "Question?", can be +# overridden via the optional `--title` command-line +# option. set NS {} set use_ttk [package vsatisfies [package provide Tk] 8.5] @@ -12,10 +16,15 @@ if {$use_ttk} { set NS ttk } +set title "Question?" if {$argc < 1} { puts stderr "Usage: $argv0 " exit 1 } else { + if {$argc > 2 && [lindex $argv 0] == "--title"} { + set title [lindex $argv 1] + set argv [lreplace $argv 0 1] + } set prompt [join $argv " "] } @@ -38,5 +47,5 @@ pack .b -side bottom -fill x -ipadx 20 -ipady 15 bind . {exit 0} bind . {exit 1} -wm title . "Question?" +wm title . $title tk::PlaceWindow .