{"id":21222990,"url":"https://github.com/imp/pager-rs","last_synced_at":"2025-03-15T01:29:31.342Z","repository":{"id":139816678,"uuid":"65035087","full_name":"imp/pager-rs","owner":"imp","description":"pager - long output best friend (gitlab mirror)","archived":false,"fork":false,"pushed_at":"2017-09-02T12:41:06.000Z","size":44,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-21T17:24:34.739Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://gitlab.com/imp/pager-rs","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/imp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-08-05T16:57:41.000Z","updated_at":"2016-11-03T18:29:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"e582e0af-4d72-4c14-8043-64096f4c4516","html_url":"https://github.com/imp/pager-rs","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imp%2Fpager-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imp%2Fpager-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imp%2Fpager-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imp%2Fpager-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/imp","download_url":"https://codeload.github.com/imp/pager-rs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243670891,"owners_count":20328544,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-20T22:48:25.916Z","updated_at":"2025-03-15T01:29:31.319Z","avatar_url":"https://github.com/imp.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Pager - long output best friend\n\n[![Build Status](https://gitlab.com/imp/pager-rs/badges/master/build.svg)](https://gitlab.com/imp/pager-rs/pipelines)\n[![Crates.io](https://img.shields.io/crates/v/pager.svg)](https://crates.io/crates/pager)\n[![Docs.rs](https://docs.rs/pager/badge.svg)](https://docs.rs/pager)\n\nDoes all the magic to have you potentially long output piped through the\nexternal pager. Similar to what `git` does for its output.\n\n# Quick Start\n\n```rust\nextern crate pager;\n\nuse pager::Pager;\n\nfn main() {\n    Pager::new().setup();\n    // The rest of your program goes here\n}\n```\n\nUnder the hood this forks the current process, connects child' stdout\nto parent's stdin, and then replaces the parent with the pager of choice\n(environment variable PAGER). The child just continues as normal. If PAGER\nenvironment variable is not present `Pager` probes current PATH for `more`.\nIf found it is used as a default pager.\n\nYou can control pager to a limited degree. For example you can change the\nenvironment variable used for finding pager executable.\n\n```rust\nextern crate pager;\n\nuse pager::Pager;\n\nfn main() {\n    Pager::with_env(\"MY_PAGER\").setup();\n    // The rest of your program goes here\n}\n```\n\nIf no suitable pager found `setup()` does nothing and your executable keeps\nrunning as usual. `Pager` cleans after itself and doesn't leak resources in\ncase of setup failure.\n\nAlternatively you can specify directly the desired pager command, exactly\nas it would appear in PAGER environment variable. This is useful if you\nneed some specific pager and/or flags (like \"less -r\") and would like to\navoid forcing your consumers into modifying their existing PAGER\nconfiguration just for your application.\n\n```rust\nextern crate pager;\nuse pager::Pager;\nfn main() {\n    Pager::with_pager(\"less -r\").setup();\n    // The rest of your program goes here\n}\n```\n\nIf you need to disable pager altogether set environment variable `NOPAGER`\nand Pager::setup() will skip initialization. The host application will continue\nas normal. Pager::is_on() will reflect the fact that no Pager is active.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimp%2Fpager-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimp%2Fpager-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimp%2Fpager-rs/lists"}