diff options
Diffstat (limited to 'Python/getopt.c')
-rw-r--r-- | Python/getopt.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/Python/getopt.c b/Python/getopt.c index c165a94..1dc8720 100644 --- a/Python/getopt.c +++ b/Python/getopt.c @@ -43,6 +43,16 @@ wchar_t *_PyOS_optarg = NULL; /* optional argument */ static wchar_t *opt_ptr = L""; +/* Python command line short and long options */ + +#define SHORT_OPTS L"bBc:dEhiIJm:OqRsStuvVW:xX:?" + +static const _PyOS_LongOption longopts[] = { + {L"check-hash-based-pycs", 1, 0}, + {NULL, 0, 0}, +}; + + void _PyOS_ResetGetOpt(void) { _PyOS_opterr = 1; @@ -51,8 +61,7 @@ void _PyOS_ResetGetOpt(void) opt_ptr = L""; } -int _PyOS_GetOpt(int argc, wchar_t **argv, wchar_t *optstring, - const _PyOS_LongOption *longopts, int *longindex) +int _PyOS_GetOpt(int argc, wchar_t **argv, int *longindex) { wchar_t *ptr; wchar_t option; @@ -128,7 +137,7 @@ int _PyOS_GetOpt(int argc, wchar_t **argv, wchar_t *optstring, return '_'; } - if ((ptr = wcschr(optstring, option)) == NULL) { + if ((ptr = wcschr(SHORT_OPTS, option)) == NULL) { if (_PyOS_opterr) fprintf(stderr, "Unknown option: -%c\n", (char)option); return '_'; |