MCPcopy Index your code
hub / github.com/pyinvoke/invoke / parse_tasks

Method parse_tasks

invoke/program.py:750–772  ·  view source on GitHub ↗

Parse leftover args, which are typically tasks & per-task args. Sets ``self.parser`` to the parser used, ``self.tasks`` to the parsed per-task contexts, and ``self.core_via_tasks`` to a context holding any core flags seen within the task contexts. Also modi

(self)

Source from the content-addressed store, hash-verified

748 )
749
750 def parse_tasks(self) -> None:
751 """
752 Parse leftover args, which are typically tasks & per-task args.
753
754 Sets ``self.parser`` to the parser used, ``self.tasks`` to the
755 parsed per-task contexts, and ``self.core_via_tasks`` to a context
756 holding any core flags seen within the task contexts.
757
758 Also modifies ``self.core`` to include the data from ``core_via_tasks``
759 (so that it correctly reflects any supplied core flags regardless of
760 where they appeared).
761
762 .. versionadded:: 1.0
763 """
764 self.parser = self._make_parser()
765 debug("Parsing tasks against {!r}".format(self.collection))
766 result = self.parser.parse_argv(self.core.unparsed)
767 self.core_via_tasks = result.pop(0)
768 self._update_core_context(
769 context=self.core[0], new_args=self.core_via_tasks.args
770 )
771 self.tasks = result
772 debug("Resulting task contexts: {!r}".format(self.tasks))
773
774 def print_task_help(self, name: str) -> None:
775 """

Callers 1

runMethod · 0.95

Calls 4

_make_parserMethod · 0.95
_update_core_contextMethod · 0.95
parse_argvMethod · 0.80
popMethod · 0.45

Tested by

no test coverage detected