Skip to content

bat as a library #423

@mre

Description

@mre

Recently I needed a way to pretty-print some Rust code to the command-line while building cargo-inspect.
I used syntect, but in a very crude way. It occured to me, that by using bat as a pretty-printer, I could piggy-back on what already exists and get features like line-numbers for free.
Probably other projects would want to do the same.

So I wonder if you considered providing a lib.rs, which would allow for using this crate as a library.
The main.rs, would then simply use the lib.rs as a dependency. That seems to be quite a common pattern. As an additional advantage, it would decouple the argument parsing from the rest of the code. Would that be possible?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions