summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2008-04-12 13:03:03 (GMT)
committerChristian Heimes <christian@cheimes.de>2008-04-12 13:03:03 (GMT)
commit7a98d2730c42fc41fd28d622b46dd334e8a2a21d (patch)
tree311675264c619da17ac7b7c097af9d2a46cb7ead /Python
parentd3ed4921644853d5dd29ed94c848a5cdedef59ef (diff)
downloadcpython-7a98d2730c42fc41fd28d622b46dd334e8a2a21d.zip
cpython-7a98d2730c42fc41fd28d622b46dd334e8a2a21d.tar.gz
cpython-7a98d2730c42fc41fd28d622b46dd334e8a2a21d.tar.bz2
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.
Diffstat (limited to 'Python')
-rw-r--r--Python/getopt.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/Python/getopt.c b/Python/getopt.c
index 659efcf..acdd5d7 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);