pager

package
v12.120.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 4 Imported by: 6

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")
)

Functions

func Complete

func Complete()

Complete finishes output redirect to pager

func Setup

func Setup(pager ...string) error

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL