v0.13.0
bat
as a library
Beginning with this release, bat
can be used as a library (#423).
This was a huge effort and I want to thank all people who made this possible: @DrSensor, @mitsuhiko, @mre, @eth-p!
- Initial attempt in #469 (@mitsuhiko)
- Second attempt, complete restructuring of the
bat
crate, see #679 (@DrSensor) - Updates to example, public API, error handling, further refactoring: #693 #873 #875 (@sharkdp)
I want to stress that this is the very first release of the library. Things are very likely to change. A lot of things are still missing (including the documentation).
That being said, you can start using it! See the example programs in examples/
.
You can see the API documentation here: https://docs.rs/bat/
Features
-
(Breaking change) Glob-based syntax mapping, see #877 and #592. With this change,
users need to update their bat config files (bat --config-file
), if they have any--map-syntax
settings
present.The option now works like this:
--map-syntax <glob-pattern>:<syntax-name>
For more information, see the
--help
text, the man page or the README.This new feature allows us to properly highlight files like:
/etc/profile
~/.ssh/config
-
--highlight-line
now accepts line ranges, see #809 (@lkalir) -
Proper wrapping support for output with wide Unicode characters, see #811 #787 and #815 (@Kogia-sima)
-
A lot of updates to existing syntaxes via #644 (@benwaffle, @keith-hall)
-
BAT_CACHE_PATH
can be used to place cachedbat
assets in a non-standard path, see #829 (@neuronull) -
Support combination of multiple styles at the same time, see #857 (@aslpavel)
Bugfixes
- Do not pass '--no-init' on newer less versions, see #749 and #786 (@sharkdp)
- 'bat cache' still takes precedence over existing files, see #666 (@sharkdp)
.sc
files should be treated as scala files, see #443 (@benwaffle)- Allow underscores and dashes in page names, see #670 (@LunarLambda)
- Keep empty lines empty, see #601 (@mbarbar)
- Wrapping does not work when piping, see #758 (@fusillicode, @allevo, @gildo)
- Allow for non-unicode filenames, see #225 (@sharkdp)
- Empty file without header produces incomplete grid, see #798 (@eth-p)
- Files named
build
don't respect shebang lines, see #685 (@sharkdp)
Other
- Parametrizable names for man page and shell completion files, see #659 #673 #656 (@eth-p)
- Enabled LTO, making
bat
about 10% faster, see #719 (@bolinfest, @sharkdp) - Suggestions non how to configure
bat
for MacOS dark mode, see README (@jerguslejko) - Extended "Integration with other tools" section (@eth-p)
- Updated instrutions on how to use
bat
as aman
-pager, see #652, see #667 (@sharkdp) - Add section concerning file encodings, see #688 and #568 (@sharkdp)
- Updated sort order of command-line options in
--help
text and manpage, see #653 and #700 (@hrlmartins) - Updates to the man page syntax, see #718 (@sharkdp)
- Japanese documentation updates, see #863 (@k-ta-yamada, @sorairolake and @wt-l00)
- Accept "default" as a theme, see #757 (@fvictorio)
- Updated Windows installation instructions, see #852 (@sorenbug)
- Updated man page, see #573 (@sharkdp)
New syntaxes
- Jinja2, see #648 (@Martin819)
- SaltStack SLS, see #658 (@Martin819)
/etc/fstab
, see #696 (@flopp and @eth-p)/etc/group
and/etc/passwd
, see #698 (@argentite)/proc/cpuinfo
and/proc/meminfo
, see #593 (@sharkdp)- Nim, see #542 (@sharkdp)
- Vue, see #826 (@chaaaaarlotte)
- CoffeScript, see #833 (@sharkdp)
New themes
- Dracula, see #687 (@clarfon)
- Nord, see #760 (@crabique)
- Solarized light and dark, see #768 (@hakamadare)
Packaging
bat
is now in the official Ubuntu and Debian repositories, see #323 and #705 (@MarcoFalke)bat
can now be installed via MacPorts, see #675 (@bn3t)- Install fish completions into 'vendor_completions.d', see #651 (@sharkdp)