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)
| 254 | // through verbatim. Kept tiny on purpose — the registry stores the |
| 255 | // canonical form, this helper only adapts it for terminal width. |
| 256 | func 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 | } |