Suppress questions after quit on replay (for regression testing.
authorEric S. Raymond <esr@thyrsus.com>
Mon, 20 Feb 2012 17:43:51 +0000 (12:43 -0500)
committerEric S. Raymond <esr@thyrsus.com>
Mon, 20 Feb 2012 17:43:51 +0000 (12:43 -0500)
sst.py

diff --git a/sst.py b/sst.py
index c42171ea645df8d280aef91dfd851d401605417c..8e3db850c8450900fce64db42d966748eb8847a4 100755 (executable)
--- a/sst.py
+++ b/sst.py
@@ -6318,6 +6318,7 @@ if __name__ == '__main__':
             game.options |= OPTION_TTY
         seed = int(time.time())
         (options, arguments) = getopt.getopt(sys.argv[1:], "r:s:txV")
+        replay = False
         for (switch, val) in options:
             if switch == '-r':
                 try:
@@ -6332,6 +6333,7 @@ if __name__ == '__main__':
                     sys.stderr.write("sst2k: seed set to %s\n" % seed)
                     line = replayfp.readline().strip()
                     arguments += line.split()[2:]
+                    replay = True
                 except ValueError:
                     sys.stderr.write("sst: replay file %s is ill-formed\n"% val)
                     raise SystemExit(1)
@@ -6380,6 +6382,8 @@ if __name__ == '__main__':
                     game.alldone = False
                 else:
                     makemoves()
+                if replay:
+                    break
                 skip(1)
                 stars()
                 skip(1)