Changeset 388 for python/vendor/current/Lib/getopt.py
- Timestamp:
- Mar 19, 2014, 11:11:30 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
python/vendor/current/Lib/getopt.py
r2 r388 1 # -*- coding: iso-8859-1 -*-2 1 """Parser for command line options. 3 2 … … 21 20 # to class-based exceptions. 22 21 # 23 # Peter Åstrand <astrand@lysator.liu.se> added gnu_getopt().22 # Peter Astrand <astrand@lysator.liu.se> added gnu_getopt(). 24 23 # 25 24 # TODO for gnu_getopt(): … … 131 130 if args[0][:2] == '--': 132 131 opts, args = do_longs(opts, args[0][2:], longopts, args[1:]) 133 elif args[0][:1] == '-' :132 elif args[0][:1] == '-' and args[0] != '-': 134 133 opts, args = do_shorts(opts, args[0][1:], shortopts, args[1:]) 135 134 else: … … 157 156 raise GetoptError('option --%s requires argument' % opt, opt) 158 157 optarg, args = args[0], args[1:] 159 elif optarg :158 elif optarg is not None: 160 159 raise GetoptError('option --%s must not have an argument' % opt, opt) 161 160 opts.append(('--' + opt, optarg or ''))
Note:
See TracChangeset
for help on using the changeset viewer.