markbt / streampager

A pager for command output or large files
MIT License
45 stars 11 forks source link

Provide a library interface #11

Closed quark-zju closed 4 years ago

quark-zju commented 4 years ago

This PR did some cleanups and extracts sp's key features as a simple library. Applications using the library interface can avoid forking and use native Rust streams (impl Read) instead of non-portable RawFds. An example was added to demostrate how it works.

markbt commented 4 years ago

Looks great! I'll make sp and spp use the library, too, which should avoid the code duplication.