MCPcopy Create free account
hub / github.com/bigdra50/unity-cli / _should_json

Function _should_json

unity_cli/cli/helpers.py:57–65  ·  view source on GitHub ↗

Return True when output should be JSON. Checks per-command --json flag first, then UNITY_CLI_JSON env via context.

(context: CLIContext, json_flag: bool)

Source from the content-addressed store, hash-verified

55
56
57def _should_json(context: CLIContext, json_flag: bool) -> bool:
58 """Return True when output should be JSON.
59
60 Checks per-command --json flag first, then UNITY_CLI_JSON env via context.
61 """
62 if json_flag:
63 configure_output(OutputMode.JSON)
64 return True
65 return context.output.is_json # UNITY_CLI_JSON env
66
67
68# =============================================================================

Callers 15

editor_listFunction · 0.90
config_showFunction · 0.90
recorder_startFunction · 0.90
recorder_stopFunction · 0.90
recorder_statusFunction · 0.90
uitree_dumpFunction · 0.90
uitree_queryFunction · 0.90
uitree_inspectFunction · 0.90
uitree_monkeyFunction · 0.90
snapshot_diffFunction · 0.90
tests_listFunction · 0.90
tests_statusFunction · 0.90

Calls 1

configure_outputFunction · 0.90

Tested by 2

tests_listFunction · 0.72
tests_statusFunction · 0.72