Commit 35f45117 authored by Cyril Plisko's avatar Cyril Plisko 🤔

More documentation

parent 8e885409
......@@ -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();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment