pipe output through $PAGER
License
jackdoe/go-pager
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
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 0
No packages published