annotate Python/getopt.c @ 63509:5fd09e410d36 2.6

Merged revisions 83429,83436 via svnmerge from svn+ssh://pythondev@svn.python.org/python/branches/release27-maint ................ r83429 | georg.brandl | 2010-08-01 21:14:56 +0200 (So, 01 Aug 2010) | 37 lines Merged revisions 83352,83356-83358,83362,83366,83368-83369 via svnmerge from svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r83352 | georg.brandl | 2010-07-31 20:11:07 +0200 (Sa, 31 Jul 2010) | 1 line #9440: Remove borderline test case that fails based on unpredictable conditions such as compiler flags. ........ r83356 | georg.brandl | 2010-07-31 21:29:15 +0200 (Sa, 31 Jul 2010) | 1 line Remove trailing whitespace. ........ r83357 | georg.brandl | 2010-07-31 21:59:55 +0200 (Sa, 31 Jul 2010) | 1 line #5778: document that sys.version can contain a newline. ........ r83358 | georg.brandl | 2010-07-31 22:05:31 +0200 (Sa, 31 Jul 2010) | 1 line #9442: do not document a specific format for sys.version; rather refer to version_info and the platform module. ........ r83362 | georg.brandl | 2010-07-31 23:12:15 +0200 (Sa, 31 Jul 2010) | 1 line #8910: add a file explaining why Lib/test/data is there. ........ r83366 | georg.brandl | 2010-07-31 23:26:40 +0200 (Sa, 31 Jul 2010) | 1 line There always is a False and True now. ........ r83368 | georg.brandl | 2010-07-31 23:40:15 +0200 (Sa, 31 Jul 2010) | 1 line #7909: the prefixes \\.\ and \\?\ indicate special Windows paths, do not try to manipulate them. See http://msdn.microsoft.com/en-us/library/aa365247%28VS.85%29.aspx for details. ........ r83369 | georg.brandl | 2010-07-31 23:41:42 +0200 (Sa, 31 Jul 2010) | 1 line Fix "Berkeley" name. ........ ................ r83436 | georg.brandl | 2010-08-01 21:33:15 +0200 (So, 01 Aug 2010) | 42 lines Merged revisions 83259,83261,83264-83265,83268-83269,83271-83272,83281 via svnmerge from svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r83259 | georg.brandl | 2010-07-30 09:03:39 +0200 (Fr, 30 Jul 2010) | 1 line Clarification. ........ r83261 | georg.brandl | 2010-07-30 09:21:26 +0200 (Fr, 30 Jul 2010) | 1 line #9230: allow Pdb.checkline() to be called without a current frame, for setting breakpoints before starting debugging. ........ r83264 | georg.brandl | 2010-07-30 10:45:26 +0200 (Fr, 30 Jul 2010) | 1 line Document the "jump" command in pdb.__doc__, and add a version tag for "until X". ........ r83265 | georg.brandl | 2010-07-30 10:54:49 +0200 (Fr, 30 Jul 2010) | 1 line #8015: fix crash when entering an empty line for breakpoint commands. Also restore environment properly when an exception occurs during the definition of commands. ........ r83268 | georg.brandl | 2010-07-30 11:23:23 +0200 (Fr, 30 Jul 2010) | 2 lines Issue #8048: Prevent doctests from failing when sys.displayhook has been reassigned. ........ r83269 | georg.brandl | 2010-07-30 11:43:00 +0200 (Fr, 30 Jul 2010) | 1 line #6719: In pdb, do not stop somewhere in the encodings machinery if the source file to be debugged is in a non-builtin encoding. ........ r83271 | georg.brandl | 2010-07-30 11:59:28 +0200 (Fr, 30 Jul 2010) | 1 line #5727: Restore the ability to use readline when calling into pdb in doctests. ........ r83272 | georg.brandl | 2010-07-30 12:29:19 +0200 (Fr, 30 Jul 2010) | 1 line #5294: Fix the behavior of pdb "continue" command when called in the top-level debugged frame. ........ r83281 | georg.brandl | 2010-07-30 15:36:43 +0200 (Fr, 30 Jul 2010) | 1 line Add myself for pdb. ........ ................
author Georg Brandl <georg@python.org>
date Sun, 01 Aug 2010 22:10:15 +0000
parents e38335d4df91
children 0abffbe7cf22
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1598
ecbadb818847 New version handles -o<string> same as -o <string>
Guido van Rossum <guido@python.org>
parents: 1585
diff changeset
1 /*---------------------------------------------------------------------------*
ecbadb818847 New version handles -o<string> same as -o <string>
Guido van Rossum <guido@python.org>
parents: 1585
diff changeset
2 * <RCS keywords>
ecbadb818847 New version handles -o<string> same as -o <string>
Guido van Rossum <guido@python.org>
parents: 1585
diff changeset
3 *
ecbadb818847 New version handles -o<string> same as -o <string>
Guido van Rossum <guido@python.org>
parents: 1585
diff changeset
4 * C++ Library
ecbadb818847 New version handles -o<string> same as -o <string>
Guido van Rossum <guido@python.org>
parents: 1585
diff changeset
5 *
ecbadb818847 New version handles -o<string> same as -o <string>
Guido van Rossum <guido@python.org>
parents: 1585
diff changeset
6 * Copyright 1992-1994, David Gottner
ecbadb818847 New version handles -o<string> same as -o <string>
Guido van Rossum <guido@python.org>
parents: 1585
diff changeset
7 *
ecbadb818847 New version handles -o<string> same as -o <string>
Guido van Rossum <guido@python.org>
parents: 1585
diff changeset
8 * All Rights Reserved
ecbadb818847 New version handles -o<string> same as -o <string>
Guido van Rossum <guido@python.org>
parents: 1585
diff changeset
9 *
61465
e38335d4df91 Recorded merge of revisions 81029 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents: 46435
diff changeset
10 * Permission to use, copy, modify, and distribute this software and its
e38335d4df91 Recorded merge of revisions 81029 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents: 46435
diff changeset
11 * documentation for any purpose and without fee is hereby granted,
1598
ecbadb818847 New version handles -o<string> same as -o <string>
Guido van Rossum <guido@python.org>
parents: 1585
diff changeset
12 * provided that the above copyright notice, this permission notice and
ecbadb818847 New version handles -o<string> same as -o <string>
Guido van Rossum <guido@python.org>
parents: 1585
diff changeset
13 * the following disclaimer notice appear unmodified in all copies.
ecbadb818847 New version handles -o<string> same as -o <string>
Guido van Rossum <guido@python.org>
parents: 1585
diff changeset
14 *
ecbadb818847 New version handles -o<string> same as -o <string>
Guido van Rossum <guido@python.org>
parents: 1585
diff changeset
15 * I DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
ecbadb818847 New version handles -o<string> same as -o <string>
Guido van Rossum <guido@python.org>
parents: 1585
diff changeset
16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL I
ecbadb818847 New version handles -o<string> same as -o <string>
Guido van Rossum <guido@python.org>
parents: 1585
diff changeset
17 * BE LIABLE FOR ANY SPECIAL, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
ecbadb818847 New version handles -o<string> same as -o <string>
Guido van Rossum <guido@python.org>
parents: 1585
diff changeset
18 * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA, OR PROFITS, WHETHER
ecbadb818847 New version handles -o<string> same as -o <string>
Guido van Rossum <guido@python.org>
parents: 1585
diff changeset
19 * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
ecbadb818847 New version handles -o<string> same as -o <string>
Guido van Rossum <guido@python.org>
parents: 1585
diff changeset
20 * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
ecbadb818847 New version handles -o<string> same as -o <string>
Guido van Rossum <guido@python.org>
parents: 1585
diff changeset
21 *
ecbadb818847 New version handles -o<string> same as -o <string>
Guido van Rossum <guido@python.org>
parents: 1585
diff changeset
22 * Nevertheless, I would like to know about bugs in this library or
ecbadb818847 New version handles -o<string> same as -o <string>
Guido van Rossum <guido@python.org>
parents: 1585
diff changeset
23 * suggestions for improvment. Send bug reports and feedback to
ecbadb818847 New version handles -o<string> same as -o <string>
Guido van Rossum <guido@python.org>
parents: 1585
diff changeset
24 * davegottner@delphi.com.
ecbadb818847 New version handles -o<string> same as -o <string>
Guido van Rossum <guido@python.org>
parents: 1585
diff changeset
25 *---------------------------------------------------------------------------*/
1585
7c75f60468f8 A getopt.c for your amusement
Guido van Rossum <guido@python.org>
parents:
diff changeset
26
39073
c48b3a68f696 Accept long options "--help" and "--version".
Georg Brandl <georg@python.org>
parents: 37655
diff changeset
27 /* Modified to support --help and --version, as well as /? on Windows
c48b3a68f696 Accept long options "--help" and "--version".
Georg Brandl <georg@python.org>
parents: 37655
diff changeset
28 * by Georg Brandl. */
c48b3a68f696 Accept long options "--help" and "--version".
Georg Brandl <georg@python.org>
parents: 37655
diff changeset
29
1585
7c75f60468f8 A getopt.c for your amusement
Guido van Rossum <guido@python.org>
parents:
diff changeset
30 #include <stdio.h>
7c75f60468f8 A getopt.c for your amusement
Guido van Rossum <guido@python.org>
parents:
diff changeset
31 #include <string.h>
7c75f60468f8 A getopt.c for your amusement
Guido van Rossum <guido@python.org>
parents:
diff changeset
32
37655
2f3f2e32dfd9 spread the extern "C" { } magic pixie dust around. Python itself builds now
Anthony Baxter <anthonybaxter@gmail.com>
parents: 15374
diff changeset
33 #ifdef __cplusplus
2f3f2e32dfd9 spread the extern "C" { } magic pixie dust around. Python itself builds now
Anthony Baxter <anthonybaxter@gmail.com>
parents: 15374
diff changeset
34 extern "C" {
2f3f2e32dfd9 spread the extern "C" { } magic pixie dust around. Python itself builds now
Anthony Baxter <anthonybaxter@gmail.com>
parents: 15374
diff changeset
35 #endif
2f3f2e32dfd9 spread the extern "C" { } magic pixie dust around. Python itself builds now
Anthony Baxter <anthonybaxter@gmail.com>
parents: 15374
diff changeset
36
15374
a826a46bae54 Move our own getopt() implementation to _PyOS_GetOpt(), and use it
Thomas Wouters <thomas@python.org>
parents: 13658
diff changeset
37 int _PyOS_opterr = 1; /* generate error messages */
a826a46bae54 Move our own getopt() implementation to _PyOS_GetOpt(), and use it
Thomas Wouters <thomas@python.org>
parents: 13658
diff changeset
38 int _PyOS_optind = 1; /* index into argv array */
a826a46bae54 Move our own getopt() implementation to _PyOS_GetOpt(), and use it
Thomas Wouters <thomas@python.org>
parents: 13658
diff changeset
39 char *_PyOS_optarg = NULL; /* optional argument */
1585
7c75f60468f8 A getopt.c for your amusement
Guido van Rossum <guido@python.org>
parents:
diff changeset
40
15374
a826a46bae54 Move our own getopt() implementation to _PyOS_GetOpt(), and use it
Thomas Wouters <thomas@python.org>
parents: 13658
diff changeset
41 int _PyOS_GetOpt(int argc, char **argv, char *optstring)
1585
7c75f60468f8 A getopt.c for your amusement
Guido van Rossum <guido@python.org>
parents:
diff changeset
42 {
61465
e38335d4df91 Recorded merge of revisions 81029 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents: 46435
diff changeset
43 static char *opt_ptr = "";
e38335d4df91 Recorded merge of revisions 81029 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents: 46435
diff changeset
44 char *ptr;
e38335d4df91 Recorded merge of revisions 81029 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents: 46435
diff changeset
45 int option;
1585
7c75f60468f8 A getopt.c for your amusement
Guido van Rossum <guido@python.org>
parents:
diff changeset
46
61465
e38335d4df91 Recorded merge of revisions 81029 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents: 46435
diff changeset
47 if (*opt_ptr == '\0') {
1598
ecbadb818847 New version handles -o<string> same as -o <string>
Guido van Rossum <guido@python.org>
parents: 1585
diff changeset
48
61465
e38335d4df91 Recorded merge of revisions 81029 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents: 46435
diff changeset
49 if (_PyOS_optind >= argc)
e38335d4df91 Recorded merge of revisions 81029 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents: 46435
diff changeset
50 return -1;
39073
c48b3a68f696 Accept long options "--help" and "--version".
Georg Brandl <georg@python.org>
parents: 37655
diff changeset
51 #ifdef MS_WINDOWS
61465
e38335d4df91 Recorded merge of revisions 81029 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents: 46435
diff changeset
52 else if (strcmp(argv[_PyOS_optind], "/?") == 0) {
e38335d4df91 Recorded merge of revisions 81029 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents: 46435
diff changeset
53 ++_PyOS_optind;
e38335d4df91 Recorded merge of revisions 81029 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents: 46435
diff changeset
54 return 'h';
e38335d4df91 Recorded merge of revisions 81029 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents: 46435
diff changeset
55 }
39073
c48b3a68f696 Accept long options "--help" and "--version".
Georg Brandl <georg@python.org>
parents: 37655
diff changeset
56 #endif
c48b3a68f696 Accept long options "--help" and "--version".
Georg Brandl <georg@python.org>
parents: 37655
diff changeset
57
61465
e38335d4df91 Recorded merge of revisions 81029 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents: 46435
diff changeset
58 else if (argv[_PyOS_optind][0] != '-' ||
e38335d4df91 Recorded merge of revisions 81029 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents: 46435
diff changeset
59 argv[_PyOS_optind][1] == '\0' /* lone dash */ )
e38335d4df91 Recorded merge of revisions 81029 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents: 46435
diff changeset
60 return -1;
1585
7c75f60468f8 A getopt.c for your amusement
Guido van Rossum <guido@python.org>
parents:
diff changeset
61
61465
e38335d4df91 Recorded merge of revisions 81029 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents: 46435
diff changeset
62 else if (strcmp(argv[_PyOS_optind], "--") == 0) {
e38335d4df91 Recorded merge of revisions 81029 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents: 46435
diff changeset
63 ++_PyOS_optind;
e38335d4df91 Recorded merge of revisions 81029 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents: 46435
diff changeset
64 return -1;
e38335d4df91 Recorded merge of revisions 81029 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents: 46435
diff changeset
65 }
1585
7c75f60468f8 A getopt.c for your amusement
Guido van Rossum <guido@python.org>
parents:
diff changeset
66
61465
e38335d4df91 Recorded merge of revisions 81029 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents: 46435
diff changeset
67 else if (strcmp(argv[_PyOS_optind], "--help") == 0) {
e38335d4df91 Recorded merge of revisions 81029 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents: 46435
diff changeset
68 ++_PyOS_optind;
e38335d4df91 Recorded merge of revisions 81029 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents: 46435
diff changeset
69 return 'h';
e38335d4df91 Recorded merge of revisions 81029 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents: 46435
diff changeset
70 }
39073
c48b3a68f696 Accept long options "--help" and "--version".
Georg Brandl <georg@python.org>
parents: 37655
diff changeset
71
61465
e38335d4df91 Recorded merge of revisions 81029 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents: 46435
diff changeset
72 else if (strcmp(argv[_PyOS_optind], "--version") == 0) {
e38335d4df91 Recorded merge of revisions 81029 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents: 46435
diff changeset
73 ++_PyOS_optind;
e38335d4df91 Recorded merge of revisions 81029 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents: 46435
diff changeset
74 return 'V';
e38335d4df91 Recorded merge of revisions 81029 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents: 46435
diff changeset
75 }
39073
c48b3a68f696 Accept long options "--help" and "--version".
Georg Brandl <georg@python.org>
parents: 37655
diff changeset
76
c48b3a68f696 Accept long options "--help" and "--version".
Georg Brandl <georg@python.org>
parents: 37655
diff changeset
77
61465
e38335d4df91 Recorded merge of revisions 81029 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents: 46435
diff changeset
78 opt_ptr = &argv[_PyOS_optind++][1];
e38335d4df91 Recorded merge of revisions 81029 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents: 46435
diff changeset
79 }
1585
7c75f60468f8 A getopt.c for your amusement
Guido van Rossum <guido@python.org>
parents:
diff changeset
80
61465
e38335d4df91 Recorded merge of revisions 81029 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents: 46435
diff changeset
81 if ( (option = *opt_ptr++) == '\0')
e38335d4df91 Recorded merge of revisions 81029 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents: 46435
diff changeset
82 return -1;
46406
c1fa2e758e05 Applied patch #2617 from Frank Wierzbicki wit some extras from me
Christian Heimes <christian@cheimes.de>
parents: 39073
diff changeset
83
61465
e38335d4df91 Recorded merge of revisions 81029 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents: 46435
diff changeset
84 if (option == 'J') {
e38335d4df91 Recorded merge of revisions 81029 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents: 46435
diff changeset
85 fprintf(stderr, "-J is reserved for Jython\n");
e38335d4df91 Recorded merge of revisions 81029 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents: 46435
diff changeset
86 return '_';
e38335d4df91 Recorded merge of revisions 81029 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents: 46435
diff changeset
87 }
46406
c1fa2e758e05 Applied patch #2617 from Frank Wierzbicki wit some extras from me
Christian Heimes <christian@cheimes.de>
parents: 39073
diff changeset
88
61465
e38335d4df91 Recorded merge of revisions 81029 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents: 46435
diff changeset
89 if (option == 'X') {
e38335d4df91 Recorded merge of revisions 81029 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents: 46435
diff changeset
90 fprintf(stderr,
e38335d4df91 Recorded merge of revisions 81029 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents: 46435
diff changeset
91 "-X is reserved for implementation-specific arguments\n");
e38335d4df91 Recorded merge of revisions 81029 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents: 46435
diff changeset
92 return '_';
e38335d4df91 Recorded merge of revisions 81029 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents: 46435
diff changeset
93 }
46406
c1fa2e758e05 Applied patch #2617 from Frank Wierzbicki wit some extras from me
Christian Heimes <christian@cheimes.de>
parents: 39073
diff changeset
94
61465
e38335d4df91 Recorded merge of revisions 81029 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents: 46435
diff changeset
95 if ((ptr = strchr(optstring, option)) == NULL) {
e38335d4df91 Recorded merge of revisions 81029 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents: 46435
diff changeset
96 if (_PyOS_opterr)
e38335d4df91 Recorded merge of revisions 81029 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents: 46435
diff changeset
97 fprintf(stderr, "Unknown option: -%c\n", option);
1585
7c75f60468f8 A getopt.c for your amusement
Guido van Rossum <guido@python.org>
parents:
diff changeset
98
61465
e38335d4df91 Recorded merge of revisions 81029 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents: 46435
diff changeset
99 return '_';
e38335d4df91 Recorded merge of revisions 81029 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents: 46435
diff changeset
100 }
1585
7c75f60468f8 A getopt.c for your amusement
Guido van Rossum <guido@python.org>
parents:
diff changeset
101
61465
e38335d4df91 Recorded merge of revisions 81029 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents: 46435
diff changeset
102 if (*(ptr + 1) == ':') {
e38335d4df91 Recorded merge of revisions 81029 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents: 46435
diff changeset
103 if (*opt_ptr != '\0') {
e38335d4df91 Recorded merge of revisions 81029 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents: 46435
diff changeset
104 _PyOS_optarg = opt_ptr;
e38335d4df91 Recorded merge of revisions 81029 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents: 46435
diff changeset
105 opt_ptr = "";
e38335d4df91 Recorded merge of revisions 81029 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents: 46435
diff changeset
106 }
1585
7c75f60468f8 A getopt.c for your amusement
Guido van Rossum <guido@python.org>
parents:
diff changeset
107
61465
e38335d4df91 Recorded merge of revisions 81029 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents: 46435
diff changeset
108 else {
e38335d4df91 Recorded merge of revisions 81029 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents: 46435
diff changeset
109 if (_PyOS_optind >= argc) {
e38335d4df91 Recorded merge of revisions 81029 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents: 46435
diff changeset
110 if (_PyOS_opterr)
e38335d4df91 Recorded merge of revisions 81029 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents: 46435
diff changeset
111 fprintf(stderr,
e38335d4df91 Recorded merge of revisions 81029 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents: 46435
diff changeset
112 "Argument expected for the -%c option\n", option);
e38335d4df91 Recorded merge of revisions 81029 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents: 46435
diff changeset
113 return '_';
e38335d4df91 Recorded merge of revisions 81029 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents: 46435
diff changeset
114 }
1585
7c75f60468f8 A getopt.c for your amusement
Guido van Rossum <guido@python.org>
parents:
diff changeset
115
61465
e38335d4df91 Recorded merge of revisions 81029 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents: 46435
diff changeset
116 _PyOS_optarg = argv[_PyOS_optind++];
e38335d4df91 Recorded merge of revisions 81029 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents: 46435
diff changeset
117 }
e38335d4df91 Recorded merge of revisions 81029 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents: 46435
diff changeset
118 }
1585
7c75f60468f8 A getopt.c for your amusement
Guido van Rossum <guido@python.org>
parents:
diff changeset
119
61465
e38335d4df91 Recorded merge of revisions 81029 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents: 46435
diff changeset
120 return option;
1585
7c75f60468f8 A getopt.c for your amusement
Guido van Rossum <guido@python.org>
parents:
diff changeset
121 }
37655
2f3f2e32dfd9 spread the extern "C" { } magic pixie dust around. Python itself builds now
Anthony Baxter <anthonybaxter@gmail.com>
parents: 15374
diff changeset
122
2f3f2e32dfd9 spread the extern "C" { } magic pixie dust around. Python itself builds now
Anthony Baxter <anthonybaxter@gmail.com>
parents: 15374
diff changeset
123 #ifdef __cplusplus
2f3f2e32dfd9 spread the extern "C" { } magic pixie dust around. Python itself builds now
Anthony Baxter <anthonybaxter@gmail.com>
parents: 15374
diff changeset
124 }
2f3f2e32dfd9 spread the extern "C" { } magic pixie dust around. Python itself builds now
Anthony Baxter <anthonybaxter@gmail.com>
parents: 15374
diff changeset
125 #endif
2f3f2e32dfd9 spread the extern "C" { } magic pixie dust around. Python itself builds now
Anthony Baxter <anthonybaxter@gmail.com>
parents: 15374
diff changeset
126