MCPcopy
hub / github.com/pallets/click / resolve_color_default

Function resolve_color_default

src/click/globals.py:54–67  ·  view source on GitHub ↗

Internal helper to get the default value of the color flag. If a value is passed it's returned unchanged, otherwise it's looked up from the current context.

(color: bool | None = None)

Source from the content-addressed store, hash-verified

52
53
54def resolve_color_default(color: bool | None = None) -> bool | None:
55 """Internal helper to get the default value of the color flag. If a
56 value is passed it's returned unchanged, otherwise it's looked up from
57 the current context.
58 """
59 if color is not None:
60 return color
61
62 ctx = get_current_context(silent=True)
63
64 if ctx is not None:
65 return ctx.color
66
67 return None

Callers 4

echoFunction · 0.85
__init__Method · 0.85
get_pager_fileFunction · 0.85
progressbarFunction · 0.85

Calls 1

get_current_contextFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…