Skip to content

Commit 1f3611e

Browse files
committed
git-gui--askyesno: allow overriding the window title
"Question?" is maybe not the most informative thing to ask. In the absence of better information, it is the best we can do, of course. However, Git for Windows' auto updater just learned the trick to use git-gui--askyesno to ask the user whether to update now or not. And in this scripted scenario, we can easily pass a command-line option to change the window title. So let's support that with the new `--title <title>` option. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent b5ed3a0 commit 1f3611e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

git-gui/git-gui--askyesno

+6-1
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,15 @@ if {$use_ttk} {
1212
set NS ttk
1313
}
1414

15+
set title "Question?"
1516
if {$argc < 1} {
1617
puts stderr "Usage: $argv0 <question>"
1718
exit 1
1819
} else {
20+
if {$argc > 2 && [lindex $argv 0] == "--title"} {
21+
set title [lindex $argv 1]
22+
set argv [lreplace $argv 0 1]
23+
}
1924
set prompt [join $argv " "]
2025
}
2126

@@ -47,5 +52,5 @@ proc yes {} {
4752
exit 0
4853
}
4954

50-
wm title . "Question?"
55+
wm title . $title
5156
tk::PlaceWindow .

0 commit comments

Comments
 (0)