mirror of https://github.com/cheat/cheat.git
chore: rename `display.Display`
Rename `display.Display` to `display.Write` for clarity and to reduce "stutter".
This commit is contained in:
parent
4ef4c35d8c
commit
cdddfbb516
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -26,5 +26,5 @@ func cmdTags(opts map[string]interface{}, conf config.Config) {
|
|||
}
|
||||
|
||||
// display the output
|
||||
display.Display(out, conf)
|
||||
display.Write(out, conf)
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue