mirror of
https://github.com/python/cpython.git
synced 2025-07-29 14:15:07 +00:00
#4458: recognize "-" as an argument, not a malformed option in gnu_getopt().
This commit is contained in:
parent
8d6c49047f
commit
a07435d3e3
3 changed files with 9 additions and 1 deletions
|
@ -130,7 +130,7 @@ def gnu_getopt(args, shortopts, longopts = []):
|
|||
|
||||
if args[0][:2] == '--':
|
||||
opts, args = do_longs(opts, args[0][2:], longopts, args[1:])
|
||||
elif args[0][:1] == '-':
|
||||
elif args[0][:1] == '-' and args[0] != '-':
|
||||
opts, args = do_shorts(opts, args[0][1:], shortopts, args[1:])
|
||||
else:
|
||||
if all_options_first:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue