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

Method list_json

invoke/program.py:895–909  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

893 return pairs
894
895 def list_json(self) -> None:
896 # Sanity: we can't cleanly honor the --list-depth argument without
897 # changing the data schema or otherwise acting strangely; and it also
898 # doesn't make a ton of sense to limit depth when the output is for a
899 # script to handle. So we just refuse, for now. TODO: find better way
900 if self.list_depth:
901 raise Exit(
902 "The --list-depth option is not supported with JSON format!"
903 ) # noqa
904 # TODO: consider using something more formal re: the format this emits,
905 # eg json-schema or whatever. Would simplify the
906 # relatively-concise-but-only-human docs that currently describe this.
907 coll = self.scoped_collection
908 data = coll.serialized()
909 print(json.dumps(data))
910
911 def task_list_opener(self, extra: str = "") -> str:
912 root = self.list_root

Callers

nothing calls this directly

Calls 2

ExitClass · 0.85
serializedMethod · 0.80

Tested by

no test coverage detected