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

Method normalize_argv

invoke/program.py:585–606  ·  view source on GitHub ↗

Massages ``argv`` into a useful list of strings. **If None** (the default), uses `sys.argv`. **If a non-string iterable**, uses that in place of `sys.argv`. **If a string**, performs a `str.split` and then executes with the result. (This is mostly a conven

(self, argv: Optional[List[str]])

Source from the content-addressed store, hash-verified

583 executor.execute(*self.tasks)
584
585 def normalize_argv(self, argv: Optional[List[str]]) -> None:
586 """
587 Massages ``argv`` into a useful list of strings.
588
589 **If None** (the default), uses `sys.argv`.
590
591 **If a non-string iterable**, uses that in place of `sys.argv`.
592
593 **If a string**, performs a `str.split` and then executes with the
594 result. (This is mostly a convenience; when in doubt, use a list.)
595
596 Sets ``self.argv`` to the result.
597
598 .. versionadded:: 1.0
599 """
600 if argv is None:
601 argv = sys.argv
602 debug("argv was None; using sys.argv: {!r}".format(argv))
603 elif isinstance(argv, str):
604 argv = argv.split()
605 debug("argv was string-like; splitting: {!r}".format(argv))
606 self.argv = argv
607
608 @property
609 def name(self) -> str:

Callers 1

parse_coreMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected