Mercurial > cpython-lru_cache-weakref
diff Python/getopt.c @ 46406:c1fa2e758e05 legacy-trunk
Applied patch #2617 from Frank Wierzbicki wit some extras from me
-J and -X are now reserved for Jython and non-standard arguments (e.g. IronPython). I've added some extra comments to make sure the reservation don't get missed in the future.
| author | Christian Heimes <christian@cheimes.de> |
|---|---|
| date | Sat, 12 Apr 2008 13:03:03 +0000 |
| parents | c48b3a68f696 |
| children | 7c21cc14b94f |
line wrap: on
line diff
--- a/Python/getopt.c Fri Apr 11 14:20:26 2008 +0000 +++ b/Python/getopt.c Sat Apr 12 13:03:03 2008 +0000 @@ -80,7 +80,18 @@ if ( (option = *opt_ptr++) == '\0') return -1; - + + if (option == 'J') { + fprintf(stderr, "-J is reserved for Jython\n"); + return '_'; + } + + if (option == 'X') { + fprintf(stderr, + "-X is reserved for non-standard arguments\n"); + return '_'; + } + if ((ptr = strchr(optstring, option)) == NULL) { if (_PyOS_opterr) fprintf(stderr, "Unknown option: -%c\n", option);
