| 2573 | return args |
| 2574 | |
| 2575 | def parse_known_intermixed_args(self, args=None, namespace=None): |
| 2576 | # returns a namespace and list of extras |
| 2577 | # |
| 2578 | # positional can be freely intermixed with optionals. optionals are |
| 2579 | # first parsed with all positional arguments deactivated. The 'extras' |
| 2580 | # are then parsed. If the parser definition is incompatible with the |
| 2581 | # intermixed assumptions (e.g. use of REMAINDER, subparsers) a |
| 2582 | # TypeError is raised. |
| 2583 | |
| 2584 | positionals = self._get_positional_actions() |
| 2585 | a = [action for action in positionals |
| 2586 | if action.nargs in [PARSER, REMAINDER]] |
| 2587 | if a: |
| 2588 | raise TypeError('parse_intermixed_args: positional arg' |
| 2589 | ' with nargs=%s'%a[0].nargs) |
| 2590 | |
| 2591 | return self._parse_known_args2(args, namespace, intermixed=True) |
| 2592 | |
| 2593 | # ======================== |
| 2594 | # Value conversion methods |