Documentation ¶
Overview ¶
Package pager provides methods for pager setup (more/less)
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrAlreadySet = errors.New("Pager already set") ErrNoPager = errors.New("There is no pager on the system") ErrStdinPipe = errors.New("Can't get pager stdin") )
View Source
var AllowEnv bool
AllowEnv is a flag that allows to user to define pager binary using PAGER environment variable
Functions ¶
func Setup ¶
Setup set up pager for work. After calling this method, any data sent to Stdout and Stderr (using fmt, fmtc, or terminal packages) will go to the pager.
Example ¶
// Use pager from PAGER env var or default (more -f) Setup() // Or provide specific command. Setup("less -MQR") // Complete must be called at the end of the program work. You can call it with defer // in your main function. defer Complete()
Output:
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.