From 067b4f263065939c1ba4fed037124ed076f69f98 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Mon, 14 Aug 2023 05:48:07 -0400 Subject: [PATCH] Avoid potential collision between the new "options" command... ...and argument-setting in replays. --- sst | 6 ++---- test/test01.log | 2 +- test/test02.log | 2 +- test/test03.log | 2 +- test/test04.log | 2 +- test/test05.log | 2 +- test/test06.log | 2 +- test/test07.log | 2 +- test/test08.log | 2 +- test/test09.log | 2 +- test/test10.log | 2 +- test/test11.log | 2 +- test/test12.log | 2 +- test/test13.log | 2 +- test/test14.log | 2 +- test/test15.log | 2 +- test/test16.log | 2 +- test/test17.log | 2 +- test/test18.log | 2 +- 19 files changed, 20 insertions(+), 22 deletions(-) diff --git a/sst b/sst index a95c9b7..e078421 100755 --- a/sst +++ b/sst @@ -6779,7 +6779,6 @@ if __name__ == '__main__': game.options |= OPTION_TTY seed = int(time.time()) (options, arguments) = getopt.getopt(sys.argv[1:], "cr:s:txV") - replay = False for (switch, val) in options: if switch == '-r': # pylint: disable=raise-missing-from @@ -6796,7 +6795,6 @@ if __name__ == '__main__': seed = eval(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) @@ -6829,7 +6827,7 @@ if __name__ == '__main__': sys.exit(1) if logfp: logfp.write("# seed %s\n" % seed) - logfp.write("# options %s\n" % " ".join(arguments)) + logfp.write("# arguments %s\n" % " ".join(arguments)) logfp.write("# SST2K version %s\n" % version) logfp.write("# recorded by %s@%s on %s\n" % \ (getpass.getuser(),socket.getfqdn(),time.ctime())) @@ -6849,7 +6847,7 @@ if __name__ == '__main__': game.alldone = False else: makemoves() - if replay: + if replayfp: break skip(1) stars() diff --git a/test/test01.log b/test/test01.log index 5f36702..e3bde23 100644 --- a/test/test01.log +++ b/test/test01.log @@ -1,5 +1,5 @@ # seed 1556084761 -# options +# arguments # SST2K version 2.4 # Test bringing game up, viewing galaxy, quitting # recorded by esr@snark.thyrsus.com on Wed Apr 24 01:46:01 2019 diff --git a/test/test02.log b/test/test02.log index e753ea4..afed55f 100644 --- a/test/test02.log +++ b/test/test02.log @@ -1,5 +1,5 @@ # seed 1556101787 -# options regular short good fancy +# arguments regular short good fancy # SST2K version 2.4 # Test critical hit on sensors # recorded by esr@snark.thyrsus.com on Wed Apr 24 06:29:47 2019 diff --git a/test/test03.log b/test/test03.log index e806862..ad6dfb3 100644 --- a/test/test03.log +++ b/test/test03.log @@ -1,5 +1,5 @@ # seed 1556102474 -# options regular short good fancy +# arguments regular short good fancy # SST2K version 2.4 # Test Tholian boxing us in followed by death by tractor beam # recorded by esr@snark.thyrsus.com on Wed Apr 24 09:48:31 2019 diff --git a/test/test04.log b/test/test04.log index 34cfcee..d2c59b4 100644 --- a/test/test04.log +++ b/test/test04.log @@ -1,5 +1,5 @@ # seed 1556116333 -# options regular short good fancy +# arguments regular short good fancy # SST2K version 2.4 # Test starbase destruction, planet destruction, docking after destruction. # recorded by esr@snark.thyrsus.com on Fri Aug 11 08:59:1 3 2023 diff --git a/test/test05.log b/test/test05.log index 8291875..0c96758 100644 --- a/test/test05.log +++ b/test/test05.log @@ -1,5 +1,5 @@ # seed 1556120044 -# options regular short good fancy +# arguments regular short good fancy # Test deep-space probes # recorded by esr@snark.thyrsus.com on Wed Apr 24 11:34:04 2019 chart diff --git a/test/test06.log b/test/test06.log index 3c565bc..141abbf 100644 --- a/test/test06.log +++ b/test/test06.log @@ -1,5 +1,5 @@ # seed 1556121767 -# options regular short good fancy +# arguments regular short good fancy # SST2K version 2.4 # Test shuttle landing with no crystals # recorded by esr@snark.thyrsus.com on Wed Apr 24 12:02:47 2019 diff --git a/test/test07.log b/test/test07.log index 62063db..847c1ce 100644 --- a/test/test07.log +++ b/test/test07.log @@ -1,5 +1,5 @@ # seed 1691789031 -# options regular medium good fancy +# arguments regular medium good fancy # SST2K version 2.7 # Test supercommander destruction. # recorded by esr@snark.thyrsus.com on Fri Aug 11 17:23:51 2023 diff --git a/test/test08.log b/test/test08.log index 6c17828..db4a397 100644 --- a/test/test08.log +++ b/test/test08.log @@ -1,5 +1,5 @@ # seed 1691831923 -# options regular medium novice fancy +# arguments regular medium novice fancy # SST2K version 2.7 # Test game-win condition # recorded by esr@snark.thyrsus.com on Sat Aug 12 05:18:43 2023 diff --git a/test/test09.log b/test/test09.log index c8217aa..f3d6c29 100644 --- a/test/test09.log +++ b/test/test09.log @@ -1,5 +1,5 @@ # seed 1691779887 -# options regular medium good fancy +# arguments regular medium good fancy # SST2K version 2.7 # Test behavior of Tholian # recorded by esr@snark.thyrsus.com on Fri Aug 11 14:51:27 2023 diff --git a/test/test10.log b/test/test10.log index 447c7e9..d8acab6 100644 --- a/test/test10.log +++ b/test/test10.log @@ -1,5 +1,5 @@ # seed 1691834337 -# options regular medium novice fancy +# arguments regular medium novice fancy # SST2K version 2.7 # Test game timeout condition # recorded by esr@snark.thyrsus.com on Sat Aug 12 05:58:57 2023 diff --git a/test/test11.log b/test/test11.log index a4cf44b..1220f8b 100644 --- a/test/test11.log +++ b/test/test11.log @@ -1,5 +1,5 @@ # seed 1556212919 -# options regular short good fancy +# arguments regular short good fancy # SST2K version 2.5 # Test loss by energy exhaustion. # recorded by esr@snark.thyrsus.com on Thu Apr 25 13:21:59 2019 diff --git a/test/test12.log b/test/test12.log index 294f978..a4c0a20 100644 --- a/test/test12.log +++ b/test/test12.log @@ -1,5 +1,5 @@ # seed 1691778615 -# options regular medium good fancy +# arguments regular medium good fancy # SST2K version 2.7 # Test dilithium mining # recorded by esr@snark.thyrsus.com on Fri Aug 11 14:30:15 2023 diff --git a/test/test13.log b/test/test13.log index e5f3d15..10e1abe 100644 --- a/test/test13.log +++ b/test/test13.log @@ -1,5 +1,5 @@ # seed 1556292107 -# options regular short good fancy +# arguments regular short good fancy # SST2K version 2.5 # Test multiple critical hits ending in defeat by Supercommander # recorded by esr@snark.thyrsus.com on Fri Apr 26 11:21:47 2019 diff --git a/test/test14.log b/test/test14.log index fc6263c..b8bce3c 100644 --- a/test/test14.log +++ b/test/test14.log @@ -1,5 +1,5 @@ # seed 1691765367 -# options +# arguments # SST2K version 2.7 # Test death by black hole # recorded by esr@snark.thyrsus.com on Fri Aug 11 10:49:27 2023 diff --git a/test/test15.log b/test/test15.log index 6396496..23957f4 100644 --- a/test/test15.log +++ b/test/test15.log @@ -1,5 +1,5 @@ # seed 1691766356 -# options regular medium good fancy +# arguments regular medium good fancy # SST2K version 2.7 # Test encounter with Romulan and multiline torpedo firing # recorded by esr@snark.thyrsus.com on Fri Aug 11 11:05:56 2023 diff --git a/test/test16.log b/test/test16.log index fc379d3..4b6e868 100644 --- a/test/test16.log +++ b/test/test16.log @@ -1,5 +1,5 @@ # seed 1691769251 -# options regular medium good fancy +# arguments regular medium good fancy # SST2K version 2.7 # Test malformed torpedo command # recorded by esr@snark.thyrsus.com on Fri Aug 11 11:54:11 2023 diff --git a/test/test17.log b/test/test17.log index ae86e9b..d753f50 100644 --- a/test/test17.log +++ b/test/test17.log @@ -1,5 +1,5 @@ # seed 1691774489 -# options regular medium good fancy +# arguments regular medium good fancy # SST2K version 2.7 # Test commander destruction and supernova alert # recorded by esr@snark.thyrsus.com on Fri Aug 11 13:31:26 2023 diff --git a/test/test18.log b/test/test18.log index f5d08dd..c9c3478 100644 --- a/test/test18.log +++ b/test/test18.log @@ -1,5 +1,5 @@ # seed 1691786582 -# options regular medium good fancy +# arguments regular medium good fancy # SST2K version 2.7 # Test behavior when emy is buffered into black hole # recorded by esr@snark.thyrsus.com on Fri Aug 11 16:43:02 2023 -- 2.31.1