code: def get_subcommand_kwargs(mgr, name, namespace):
      
      subcmd = mgr.get(name)
      subcmd_kwargs = {}
      for opt in list(subcmd.args.values()) + list(subcmd.options.values()):
          if hasattr(namespace, opt.dest):
              subcmd_kwargs[opt.dest] = getattr(namespace, opt.dest)
      return (subcmd, subcmd_kwargs)
docs: Get subcommand options from global parsed
      arguments.