chore: rename `display.Display`

Rename `display.Display` to `display.Write` for clarity and to reduce
"stutter".
This commit is contained in:
Chris Lane 2020-11-27 22:35:24 -05:00
parent 4ef4c35d8c
commit cdddfbb516
6 changed files with 8 additions and 8 deletions

View File

@ -27,5 +27,5 @@ func cmdDirectories(opts map[string]interface{}, conf config.Config) {
// write columnized output to stdout
w.Flush()
display.Display(out.String(), conf)
display.Write(out.String(), conf)
}

View File

@ -105,5 +105,5 @@ func cmdList(opts map[string]interface{}, conf config.Config) {
// write columnized output to stdout
w.Flush()
display.Display(out.String(), conf)
display.Write(out.String(), conf)
}

View File

@ -91,5 +91,5 @@ func cmdSearch(opts map[string]interface{}, conf config.Config) {
// display the output
// NB: resist the temptation to call `display.Display` multiple times in
// the loop above. That will not play nicely with the paginator.
display.Display(out, conf)
display.Write(out, conf)
}

View File

@ -26,5 +26,5 @@ func cmdTags(opts map[string]interface{}, conf config.Config) {
}
// display the output
display.Display(out, conf)
display.Write(out, conf)
}

View File

@ -50,7 +50,7 @@ func cmdView(opts map[string]interface{}, conf config.Config) {
}
// display the cheatsheet
display.Display(display.Indent(sheet.Text), conf)
display.Write(display.Indent(sheet.Text), conf)
}
}
@ -76,5 +76,5 @@ func cmdView(opts map[string]interface{}, conf config.Config) {
}
// display the cheatsheet
display.Display(sheet.Text, conf)
display.Write(sheet.Text, conf)
}

View File

@ -9,9 +9,9 @@ import (
"github.com/cheat/cheat/internal/config"
)
// Display writes output either directly to stdout, or through a pager,
// Write writes output either directly to stdout, or through a pager,
// depending upon configuration.
func Display(out string, conf config.Config) {
func Write(out string, conf config.Config) {
// if no pager was configured, print the output to stdout and exit
if conf.Pager == "" {
fmt.Print(out)