Skip to content

jackdoe/go-pager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

package pager // import "github.com/jackdoe/go-pager"


FUNCTIONS

func Pager(try ...string) (io.Writer, func())
    Create new pager executing a command based on $PAGER env var or array of
    executables Example:

        p, close := pager.Pager("less", "more","cat")
        defer close()

        p.Write("hello world")

    Will try to find $PAGER,less,more,cat in path, first one it finds it will
    pipe the output written to the returned Writer, if nothing is found it will
    return os.Stdout, if $PAGER=NOPAGER it will return os.Stdout, if $PAGER is
    specified but cant be found in path it will panic

About

pipe output through $PAGER

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages