feat(pagination): implement paginated output

Implement a `pager` config option. If configured, `cheat` will
automatically pipe output through the configured pager (where
appropriate).
This commit is contained in:
Chris Lane
2020-06-25 18:21:51 -04:00
parent 8e602b0e93
commit 59d5c96c24
9 changed files with 78 additions and 10 deletions

View File

@@ -6,6 +6,7 @@ import (
"strings"
"github.com/cheat/cheat/internal/config"
"github.com/cheat/cheat/internal/display"
"github.com/cheat/cheat/internal/sheets"
)
@@ -47,5 +48,5 @@ func cmdView(opts map[string]interface{}, conf config.Config) {
}
// display the cheatsheet
fmt.Print(sheet.Text)
display.Display(sheet.Text, conf)
}