diff options
Diffstat (limited to 'Python/getopt.c')
-rw-r--r-- | Python/getopt.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/Python/getopt.c b/Python/getopt.c index e96eb6c..af5b03c 100644 --- a/Python/getopt.c +++ b/Python/getopt.c @@ -86,17 +86,19 @@ int _PyOS_GetOpt(int argc, char **argv, char *optstring) opt_ptr = &argv[_PyOS_optind++][1]; } - if ( (option = *opt_ptr++) == '\0') + if ((option = *opt_ptr++) == '\0') return -1; if (option == 'J') { - fprintf(stderr, "-J is reserved for Jython\n"); + if (_PyOS_opterr) + fprintf(stderr, "-J is reserved for Jython\n"); return '_'; } if (option == 'X') { - fprintf(stderr, - "-X is reserved for implementation-specific arguments\n"); + if (_PyOS_opterr) + fprintf(stderr, + "-X is reserved for implementation-specific arguments\n"); return '_'; } @@ -117,7 +119,7 @@ int _PyOS_GetOpt(int argc, char **argv, char *optstring) if (_PyOS_optind >= argc) { if (_PyOS_opterr) fprintf(stderr, - "Argument expected for the -%c option\n", option); + "Argument expected for the -%c option\n", option); return '_'; } |