#16306: report only the first unknown option and add more tests. Patch by Serhiy Storchaka.
diff --git a/Modules/main.c b/Modules/main.c
index 5d1d896..17aebae 100644
--- a/Modules/main.c
+++ b/Modules/main.c
@@ -339,6 +339,7 @@
/* Hash randomization needed early for all string operations
(including -W and -X options). */
+ _PyOS_opterr = 0; /* prevent printing the error in 1st pass */
while ((c = _PyOS_GetOpt(argc, argv, PROGRAM_OPTS)) != EOF) {
if (c == 'm' || c == 'c') {
/* -c / -m is the last option: following arguments are