summaryrefslogtreecommitdiff
path: root/Python/getopt.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/getopt.c')
-rw-r--r--Python/getopt.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/Python/getopt.c b/Python/getopt.c
index 659efcfff8..acdd5d778b 100644
--- a/Python/getopt.c
+++ b/Python/getopt.c
@@ -80,7 +80,18 @@ int _PyOS_GetOpt(int argc, char **argv, char *optstring)
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);