From c43f7478feb99db21f03d41ce670584a95860731 Mon Sep 17 00:00:00 2001 From: Cyril Plisko Date: Wed, 5 Jul 2017 09:46:42 +0300 Subject: Update README.md --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index 2dcd12b..dd19f3b 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,21 @@ If no suitable pager found `setup()` does nothing and your executable keeps running as usual. `Pager` cleans after itself and doesn't leak resources in case of setup failure. +Alternatively you can specify directly the desired pager command, exactly +as it would appear in PAGER environment variable. This is useful if you +need some specific pager and/or flags (like "less -r") and would like to +avoid forcing your consumers into modifying their existing PAGER +configuration just for your application. + +```rust +extern crate pager; +use pager::Pager; +fn main() { + Pager::with_pager("less -r").setup(); + // The rest of your program goes here +} +``` + If you need to disable pager altogether set environment variable `NOPAGER` and Pager::setup() will skip initialization. The host application will continue as normal. Pager::is_on() will reflect the fact that no Pager is active. -- cgit v1.2.3