Cargo Features

bat = { version = "0.24.0", default-features = false, features = ["application", "minimal-application", "git", "paging", "lessopen", "build-assets", "regex-onig", "regex-fancy"] }
default = application

The application feature is set by default whenever bat is added without default-features = false somewhere in the dependency tree.

application default = bugreport, build-assets, git, minimal-application

Feature required for bat the application. Should be disabled when depending on bat as a library.

minimal-application application = clap, etcetera, paging, regex-onig, wild

Mainly for developers that want to iterate quickly Be aware that the included features might change in the future

Affects config::get_pager_executable

git application = git2

Support indicating git modifications

paging minimal-application? = grep-cli, shell-words

Support applying a pager on the output

Affects config::Config.paging_mode, config::get_pager_executable

lessopen = os_str_bytes, run_script

Support $LESSOPEN preprocessor

Affects config::Config.use_lessopen

build-assets application = regex, walkdir

Enables plist-load and yaml-load of syntect

regex-onig minimal-application?

You need to use one of these if you depend on bat as a library:
Use the "oniguruma" regex engine

Enables regex-onig of syntect


Use the rust-only "fancy-regex" engine

Enables regex-fancy of syntect

Features from optional dependencies

In crates that don't use the dep: syntax, optional dependencies automatically become Cargo features. These features may have been created by mistake, and this functionality may be removed in the future.

wild minimal-application?
shell-words paging?
bugreport application
etcetera minimal-application?
grep-cli paging?
regex build-assets?
walkdir build-assets?
os_str_bytes lessopen?

Enables os_str_bytes ~6.4

run_script lessopen?
clap minimal-application?
git2 git?