change i/o checks to use a simple regex for --getseed and -o. The addition of --norefresh could create weird situations with wrong behavior with the old check.

This commit is contained in:
strohitv 2025-07-06 14:33:40 +02:00
parent fc5f8cd9fa
commit cdc6ef6b63

4
s3s.py
View File

@ -1842,7 +1842,7 @@ def main():
# i/o checks
############
if getseed and len(sys.argv) > 2 and "--skipprefetch" not in sys.argv and "--norefresh" not in sys.argv:
if getseed and any(re.search("^(--getseed|--skipprefetch|--norefresh|[0-9]*)$", arg) is None for arg in sys.argv[1:]):
print("Cannot use --getseed with other arguments. Exiting.")
sys.exit(0)
@ -1854,7 +1854,7 @@ def main():
print("That doesn't make any sense! :) Exiting.")
sys.exit(0)
elif outfile and len(sys.argv) > 2 and "--skipprefetch" not in sys.argv and "--norefresh" not in sys.argv:
elif outfile and any(re.search("^(-o|--skipprefetch|--norefresh|[0-9]*)$", arg) is None for arg in sys.argv[1:]):
print("Cannot use -o with other arguments. Exiting.")
sys.exit(0)