Given the `args` left unused by a `parse_global_options`, return the invoked subcommand, the subcommand options, and the subcommand arguments.
(self, args)
| 744 | return options, subargs |
| 745 | |
| 746 | def parse_subcommand(self, args): |
| 747 | """Given the `args` left unused by a `parse_global_options`, |
| 748 | return the invoked subcommand, the subcommand options, and the |
| 749 | subcommand arguments. |
| 750 | """ |
| 751 | # Help is default command |
| 752 | if not args: |
| 753 | args = ["help"] |
| 754 | |
| 755 | cmdname = args.pop(0) |
| 756 | subcommand = self._subcommand_for_name(cmdname) |
| 757 | if not subcommand: |
| 758 | raise UserError(f"unknown command '{cmdname}'") |
| 759 | |
| 760 | suboptions, subargs = subcommand.parse_args(args) |
| 761 | return subcommand, suboptions, subargs |
| 762 | |
| 763 | |
| 764 | optparse.Option.ALWAYS_TYPED_ACTIONS += ("callback",) |
no test coverage detected