MCPcopy Create free account
hub / github.com/diillson/chatcli / formatDefaultValue

Function formatDefaultValue

cli/config_env_defaults.go:256–266  ·  view source on GitHub ↗

formatDefaultValue normalizes the displayed form of a registered default. Long URLs and paths get shortened so they don't blow past the column width that the /config grid uses; everything else goes through verbatim. Kept tiny on purpose — the registry stores the canonical form, this helper only adap

(v string)

Source from the content-addressed store, hash-verified

254// through verbatim. Kept tiny on purpose — the registry stores the
255// canonical form, this helper only adapts it for terminal width.
256func formatDefaultValue(v string) string {
257 v = strings.TrimSpace(v)
258 if v == "" {
259 return v
260 }
261 const maxDisplay = 60
262 if len(v) <= maxDisplay {
263 return v
264 }
265 return v[:maxDisplay-3] + "..."
266}

Callers 1

envOrFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected