MCPcopy Index your code
hub / github.com/coder/coder / wrapTTY

Function wrapTTY

cli/help.go:44–47  ·  view source on GitHub ↗

wrapTTY wraps a string to the width of the terminal, or 80 no terminal is detected.

(s string)

Source from the content-addressed store, hash-verified

42// wrapTTY wraps a string to the width of the terminal, or 80 no terminal
43// is detected.
44func wrapTTY(s string) string {
45 // #nosec G115 - Safe conversion as TTY width is expected to be within uint range
46 return wordwrap.WrapString(s, uint(ttyWidth()))
47}
48
49var usageTemplate = func() *template.Template {
50 var (

Callers 1

help.goFile · 0.85

Calls 1

ttyWidthFunction · 0.85

Tested by

no test coverage detected