MCPcopy
hub / github.com/cheat/cheat / Write

Function Write

internal/display/write.go:14–23  ·  view source on GitHub ↗

Write writes output either directly to stdout, or through a pager, depending upon configuration.

(out string, conf config.Config)

Source from the content-addressed store, hash-verified

12// Write writes output either directly to stdout, or through a pager,
13// depending upon configuration.
14func Write(out string, conf config.Config) {
15 // if no pager was configured, print the output to stdout and exit
16 if conf.Pager == "" {
17 fmt.Print(out)
18 os.Exit(0)
19 }
20
21 // otherwise, pipe output through the pager
22 writeToPager(out, conf)
23}
24
25// writeToPager writes output through a pager command
26func writeToPager(out string, conf config.Config) {

Callers 5

cmdViewFunction · 0.92
cmdSearchFunction · 0.92
cmdListFunction · 0.92
cmdDirectoriesFunction · 0.92
cmdTagsFunction · 0.92

Calls 1

writeToPagerFunction · 0.85

Tested by

no test coverage detected