(doc)
| 452 | |
| 453 | |
| 454 | def parse_defaults(doc): |
| 455 | # in python < 2.7 you can't pass flags=re.MULTILINE |
| 456 | split = re.split('\n *(<\S+?>|-\S+?)', doc)[1:] |
| 457 | split = [s1 + s2 for s1, s2 in zip(split[::2], split[1::2])] |
| 458 | options = [Option.parse(s) for s in split if s.startswith('-')] |
| 459 | #arguments = [Argument.parse(s) for s in split if s.startswith('<')] |
| 460 | #return options, arguments |
| 461 | return options |
| 462 | |
| 463 | |
| 464 | def printable_usage(doc): |