summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorCyril Plisko <cyril.plisko@mountall.com>2016-08-09 17:20:49 +0300
committerCyril Plisko <cyril.plisko@mountall.com>2016-08-09 17:20:49 +0300
commit35f45117c48c88c0d9057873fe6f82519f4281a0 (patch)
treeb76eca42173ef9f182abc5b2cbbab60cb8b46574 /src
parent8e8854090a5f206416d992090276fe2985e04e23 (diff)
More documentation
Diffstat (limited to 'src')
-rw-r--r--src/lib.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/lib.rs b/src/lib.rs
index c88fbee..017e88e 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -53,6 +53,7 @@ pub struct Pager {
}
impl Pager {
+ /// Creates new instance of pager with default settings
pub fn new() -> Self {
let pager = find_pager(DEFAULT_PAGER_ENV);
@@ -63,6 +64,7 @@ impl Pager {
}
}
+ /// Creates new instance of pager using `env` environment variable instead of PAGER
pub fn env(env: &str) -> Self {
let pager = find_pager(env);
@@ -73,10 +75,13 @@ impl Pager {
}
}
+ /// Gives quick assessment of successful Pager setup
pub fn ok(&self) -> bool {
self.ok
}
+ /// Initiates Pager framework and sets up all the necessary environment for sending standard
+ /// output to the activated pager.
pub fn setup(&mut self) {
if let Some(ref pager) = self.pager {
let (pager_stdin, main_stdout) = pipe();