def get_parsed_arguments(
        self, env: "EnvVarsManager"
    ) -> tuple[dict[str, str], tuple[str, ...]]:
        """
        Returns a dict of parsed arguments, and a list extra arguments.

        If no args are defined for the task then all arguments are "extra",
        otherwise its only arguments passed after a `--`.
        """

        if self._parsed_args is None:
            all_args = self.invocation[1:]

            if task_args := self.spec.args:
                try:
                    split_index = all_args.index("--")
                    option_args = all_args[:split_index]
                    extra_args = all_args[split_index + 1 :]
                except ValueError:
                    option_args = all_args
                    extra_args = tuple()

                self._parsed_args = (
                    task_args.parse(option_args, env, self.ctx.ui.program_name),
                    extra_args,
                )

            else:
                self._parsed_args = ({}, all_args)

        return self._parsed_args

        Returns a dict of parsed arguments, and a list extra arguments.

        If no args are defined for the task then all arguments are "extra",
        otherwise its only arguments passed after a `--`.
        
poethepoet/task/base.py