mirror of
https://github.com/sharkdp/bat.git
synced 2025-09-02 19:32:25 +01:00
Compare commits
101 Commits
v0.19.0
...
bat-plugin
Author | SHA1 | Date | |
---|---|---|---|
|
aa35cb52c4 | ||
|
446b9181e6 | ||
|
040242c9be | ||
|
dbf78d280a | ||
|
bc91af3ee5 | ||
|
3811615606 | ||
|
3339eee2dc | ||
|
e9f8370b13 | ||
|
892b186ba5 | ||
|
6db64cf050 | ||
|
5f139e5ec2 | ||
|
8b50ef87fd | ||
|
405e5f7460 | ||
|
8d4f8ba1b2 | ||
|
d3f89bc4bc | ||
|
5fe9b3e1b3 | ||
|
dc7d5a862f | ||
|
4789c71a37 | ||
|
be99b759d3 | ||
|
5f7ae6b277 | ||
|
ea5aaa03a2 | ||
|
7334ab4542 | ||
|
719248f1c1 | ||
|
ef3e398b2b | ||
|
52bab63e18 | ||
|
0851bbbb28 | ||
|
05ebf5ed26 | ||
|
adea895026 | ||
|
a6bd28a78b | ||
|
b5294f1cb2 | ||
|
5114c0189d | ||
|
f2727d74d5 | ||
|
735bee47eb | ||
|
a05ac53040 | ||
|
acb1231e40 | ||
|
3ae05333b0 | ||
|
4291fd5c65 | ||
|
b0898900ce | ||
|
3239d3be2a | ||
|
19033d7315 | ||
|
520081a92c | ||
|
47e0dc22d2 | ||
|
33a984992b | ||
|
b1e67e215c | ||
|
49317adcd3 | ||
|
738304fe27 | ||
|
a191552031 | ||
|
cec7229b6a | ||
|
e735562098 | ||
|
1b030dc03b | ||
|
c0ec03e08a | ||
|
9ab378b5dc | ||
|
a153a78d7a | ||
|
3ff738602e | ||
|
282b70291f | ||
|
6330f36495 | ||
|
e7df748b6d | ||
|
67124f8513 | ||
|
16f940c2d3 | ||
|
da5921b4a9 | ||
|
cde239e809 | ||
|
97a98e037d | ||
|
3ffff8d2d8 | ||
|
95796a9cc0 | ||
|
7be9485c36 | ||
|
448bfaf748 | ||
|
0655ecf23d | ||
|
671fc952bc | ||
|
3c057aa590 | ||
|
8e8c350391 | ||
|
1ee49b4d97 | ||
|
14ddda0a8b | ||
|
36093dd3bc | ||
|
ad6cae433a | ||
|
e4f6fb2afe | ||
|
d21f1e8f17 | ||
|
f6ce5d2054 | ||
|
b60225051d | ||
|
f2166ec6ec | ||
|
491d32cbf3 | ||
|
478712be38 | ||
|
d5d2fc4016 | ||
|
ed7cd1c45b | ||
|
f340893a21 | ||
|
9ad147278f | ||
|
4e36a56014 | ||
|
312c8ef01f | ||
|
f3f8194932 | ||
|
6ce26c43c9 | ||
|
486510395b | ||
|
2ae4ffcdfa | ||
|
f5a7f86a64 | ||
|
0fa99518ce | ||
|
a565662cf3 | ||
|
af44f0b3ff | ||
|
5ae1957c0e | ||
|
36be8d5929 | ||
|
a05c8ee1a8 | ||
|
eb4b1eb28f | ||
|
9287cf6b0b | ||
|
76aa138230 |
21
.github/ISSUE_TEMPLATE/bug_report.md
vendored
21
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -7,9 +7,26 @@ assignees: ''
|
||||
|
||||
---
|
||||
|
||||
<!-- Hey there, thank you for creating an issue! -->
|
||||
<!--
|
||||
|
||||
**Describe the bug you encountered:**
|
||||
Hey there, thank you for reporting a bug!
|
||||
|
||||
Please note that the following bugs have already been reported:
|
||||
|
||||
* dpkg: error processing archive /some/path/some-program.deb (--unpack):
|
||||
trying to overwrite '/usr/.crates2.json'
|
||||
|
||||
See https://github.com/sharkdp/bat/issues/938
|
||||
|
||||
-->
|
||||
|
||||
**What steps will reproduce the bug?**
|
||||
|
||||
1. step 1
|
||||
2. step 2
|
||||
3. ...
|
||||
|
||||
**What happens?**
|
||||
|
||||
...
|
||||
|
||||
|
2
.github/ISSUE_TEMPLATE/question.md
vendored
2
.github/ISSUE_TEMPLATE/question.md
vendored
@@ -7,3 +7,5 @@ assignees: ''
|
||||
|
||||
---
|
||||
|
||||
<!-- Using a normal ticket is still fine, but feel free to ask your
|
||||
questions about bat on https://github.com/sharkdp/bat/discussions instead. -->
|
||||
|
14
.github/workflows/CICD.yml
vendored
14
.github/workflows/CICD.yml
vendored
@@ -118,6 +118,18 @@ jobs:
|
||||
toolchain: stable
|
||||
default: true
|
||||
profile: minimal
|
||||
- name: Print -h
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: run
|
||||
args: --locked -- -h
|
||||
- name: Print --help
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: run
|
||||
args: --locked -- --help
|
||||
- name: Show man page
|
||||
run: man $(find . -name bat.1)
|
||||
- name: Check documentation
|
||||
env:
|
||||
RUSTDOCFLAGS: -D warnings
|
||||
@@ -142,7 +154,7 @@ jobs:
|
||||
- { target: x86_64-apple-darwin , os: macos-10.15 }
|
||||
- { target: x86_64-pc-windows-gnu , os: windows-2019 }
|
||||
- { target: x86_64-pc-windows-msvc , os: windows-2019 }
|
||||
- { target: x86_64-unknown-linux-gnu , os: ubuntu-20.04 }
|
||||
- { target: x86_64-unknown-linux-gnu , os: ubuntu-20.04, use-cross: true }
|
||||
- { target: x86_64-unknown-linux-musl , os: ubuntu-20.04, use-cross: true }
|
||||
steps:
|
||||
- name: Checkout source code
|
||||
|
8
.gitmodules
vendored
8
.gitmodules
vendored
@@ -236,3 +236,11 @@
|
||||
[submodule "assets/syntaxes/02_Extra/Dart"]
|
||||
path = assets/syntaxes/02_Extra/Dart
|
||||
url = https://github.com/elMuso/Dartlight.git
|
||||
[submodule "assets/syntaxes/02_Extra/SublimeJQ"]
|
||||
path = assets/syntaxes/02_Extra/SublimeJQ
|
||||
url = https://github.com/zogwarg/SublimeJQ.git
|
||||
[submodule "assets/syntaxes/02_Extra/cmd-help"]
|
||||
path = assets/syntaxes/02_Extra/cmd-help
|
||||
url = https://github.com/victor-gp/cmd-help-sublime-syntax.git
|
||||
branch = main
|
||||
shallow = true
|
||||
|
86
CHANGELOG.md
86
CHANGELOG.md
@@ -1,3 +1,89 @@
|
||||
# unreleased
|
||||
|
||||
## Features
|
||||
|
||||
- Make the default macOS theme depend on Dark Mode. See #2197, #1746 (@Enselic)
|
||||
|
||||
## Bugfixes
|
||||
|
||||
## Other
|
||||
|
||||
- Relaxed glibc requirements on amd64, see #2106 and #2194 (@sharkdp)
|
||||
|
||||
## Syntaxes
|
||||
|
||||
## Themes
|
||||
|
||||
## `bat` as a library
|
||||
|
||||
|
||||
# v0.21.0
|
||||
|
||||
## Features
|
||||
|
||||
- Correctly render tab stops in `--show-all`, see #2038 (@Synthetica9)
|
||||
- Add a `--style=default` option and make it the default. It is less verbose than `full`, see #2061 (@IsaacHorvath)
|
||||
- Enable BusyBox `less` as pager, see #2162 (@nfisher1226)
|
||||
- File extensions are now matched case-insensitively. See #1854, #2181 (@Enselic)
|
||||
|
||||
## Bugfixes
|
||||
|
||||
- Bump `regex` dependency from 1.5.4 to 1.5.5 to fix [CVE-2022-24713](https://blog.rust-lang.org/2022/03/08/cve-2022-24713.html), see #2145, #2139 (@Enselic)
|
||||
- `bat` no longer crashes when encountering files that references missing syntaxes. See #915, #2181 (@Enselic)
|
||||
|
||||
## Performance
|
||||
|
||||
- Skip syntax highlighting on long lines (> 16384 chars) to help improve performance. See #2165 (@keith-hall)
|
||||
- Vastly improve startup time by lazy-loading syntaxes via syntect 5.0.0. This makes bat display small files ~75% faster than before. See #951, #2181 (@Enselic)
|
||||
|
||||
## Other
|
||||
|
||||
- Include info about custom assets in `--diagnostics` if used. See #2107, #2144 (@Enselic)
|
||||
|
||||
## Syntaxes
|
||||
|
||||
- Mapped clang-format config file (.clang-format) to YAML syntax (@TruncatedDinosour)
|
||||
- log syntax: improved handling of escape characters in double quoted strings. See #2123 (@keith-hall)
|
||||
- Associate `/var/spool/mail/*` and `/var/mail/*` with the `Email` syntax. See #2156 (@cyqsimon)
|
||||
- Added cmd-help syntax to scope --help messages. See #2148 (@victor-gp)
|
||||
- Slightly adjust Zig syntax. See #2136 (@Enselic)
|
||||
- Associate `.inf` files with the `INI` syntax. See #2190 (@Enselic)
|
||||
|
||||
## `bat` as a library
|
||||
|
||||
- Allow configuration of `show_nonprintable` with `PrettyPrinter`, see #2142
|
||||
- The binary format of syntaxes.bin has been changed due to syntaxes now being lazy-loaded via syntect 5.0.0. See #2181 (@Enselic)
|
||||
- Mark `bat::error::Error` enum as `#[non_exhaustive]` to allow adding new variants without future semver breakage. See #2181 (@Enselic)
|
||||
- Change `Error::SyntectError(syntect::LoadingError)` to `Error::SyntectError(syntect::Error)`. See #2181 (@Enselic)
|
||||
- Add `Error::SyntectLoadingError(syntect::LoadingError)` enum variant. See #2181 (@Enselic)
|
||||
|
||||
|
||||
# v0.20.0
|
||||
|
||||
## Features
|
||||
|
||||
- New style component `header-filesize` to show size of the displayed file in the header. See #1988 (@mdibaiee)
|
||||
- Use underline for line highlighting on ANSI, see #1730 (@mdibaiee)
|
||||
|
||||
## Bugfixes
|
||||
|
||||
- Fix bash completion on bash 3.x and bash-completion 1.x. See #2066 (@joshpencheon)
|
||||
|
||||
## Syntaxes
|
||||
|
||||
- `GraphQL`: Add support for interfaces implementing interfaces and consider ampersand an operator. See #2000
|
||||
- Associate `_vimrc` and `_gvimrc` files with the `VimL` syntax. See #2002
|
||||
- Associate `poetry.lock` files with the `TOML` syntax. See #2049
|
||||
- Associate `.mesh`, `.task`, `.rgen`, `.rint`, `.rahit`, `.rchit`, `.rmiss`, and `.rcall` with the `GLSL` syntax. See #2050
|
||||
- Added support for `JQ` syntax, see #2072
|
||||
- Properly associate global git config files rooted in `$XDG_CONFIG_HOME/git/` or `$HOME/.config/git/`. See #2067 (@cyqsimon)
|
||||
|
||||
## `bat` as a library
|
||||
|
||||
- Exposed `get_syntax_set` and `get_theme` methods on `HighlightingAssets`. See #2030 (@dandavison)
|
||||
- Added `HeaderFilename` and `HeaderFilesize` to `StyleComponent` enum, and mark it `#[non_exhaustive]`. See #1988 (@mdibaiee)
|
||||
|
||||
|
||||
# v0.19.0
|
||||
|
||||
## Performance
|
||||
|
@@ -46,3 +46,25 @@ If you really think that a particular syntax or theme should be added for all
|
||||
users, please read the corresponding
|
||||
[documentation](https://github.com/sharkdp/bat/blob/master/doc/assets.md)
|
||||
first.
|
||||
|
||||
|
||||
## Regression tests
|
||||
|
||||
You are strongly encouraged to add regression tests. Regression tests are great,
|
||||
not least because they:
|
||||
|
||||
* ensure that your contribution will never completely stop working,
|
||||
|
||||
* makes code review easier, because it becomes very clear what the code is
|
||||
supposed to do.
|
||||
|
||||
For functional changes, you most likely want to add a test to
|
||||
[`tests/integration_tests.rs`](https://github.com/sharkdp/bat/blob/master/tests/integration_tests.rs).
|
||||
Look at existing tests to know how to write a new test. In short, you will
|
||||
invoke the `bat` binary with a certain set of arguments, and then assert on
|
||||
stdout/stderr.
|
||||
|
||||
To learn how to write regression tests for theme and syntax changes, read the
|
||||
[Syntax
|
||||
tests](https://github.com/sharkdp/bat/blob/master/doc/assets.md#syntax-tests)
|
||||
section in `assets.md`.
|
||||
|
257
Cargo.lock
generated
257
Cargo.lock
generated
@@ -19,11 +19,11 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "ansi_colours"
|
||||
version = "1.0.4"
|
||||
version = "1.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "60e2fb6138a49ad9f1cb3c6d8f8ccbdd5e62b4dab317c1b435a47ecd7da1d28f"
|
||||
checksum = "32678233b67f9056b0c144b39d46dc3218637e8d84ad6038ded339e08b19620d"
|
||||
dependencies = [
|
||||
"cc",
|
||||
"rgb",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -37,9 +37,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "assert_cmd"
|
||||
version = "2.0.2"
|
||||
version = "2.0.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e996dc7940838b7ef1096b882e29ec30a3149a3a443cdc8dba19ed382eca1fe2"
|
||||
checksum = "93ae1ddd39efd67689deb1979d80bad3bf7f2b09c6e6117c8d1f2443b5e2f83e"
|
||||
dependencies = [
|
||||
"bstr",
|
||||
"doc-comment",
|
||||
@@ -74,7 +74,7 @@ checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd"
|
||||
|
||||
[[package]]
|
||||
name = "bat"
|
||||
version = "0.19.0"
|
||||
version = "0.21.0"
|
||||
dependencies = [
|
||||
"ansi_colours",
|
||||
"ansi_term",
|
||||
@@ -82,6 +82,7 @@ dependencies = [
|
||||
"atty",
|
||||
"bincode",
|
||||
"bugreport",
|
||||
"bytesize",
|
||||
"clap",
|
||||
"clircle",
|
||||
"console",
|
||||
@@ -97,6 +98,7 @@ dependencies = [
|
||||
"path_abs",
|
||||
"predicates",
|
||||
"regex",
|
||||
"rlua",
|
||||
"semver",
|
||||
"serde",
|
||||
"serde_yaml",
|
||||
@@ -154,15 +156,27 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "bugreport"
|
||||
version = "0.4.1"
|
||||
version = "0.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0014b4b2b4f63bfe69c3838470121290cc437fdc79785d408a761a21e8b2404c"
|
||||
checksum = "535120b8182547808081a66f1f77a64533c780b23da26763e0ee34dfb94f98c9"
|
||||
dependencies = [
|
||||
"git-version",
|
||||
"shell-escape",
|
||||
"sys-info",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "bytemuck"
|
||||
version = "1.7.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "439989e6b8c38d1b6570a384ef1e49c8848128f5a97f3914baef02920842712f"
|
||||
|
||||
[[package]]
|
||||
name = "bytesize"
|
||||
version = "1.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6c58ec36aac5066d5ca17df51b3e70279f5670a72102f5752cb7e7c856adfc70"
|
||||
|
||||
[[package]]
|
||||
name = "cc"
|
||||
version = "1.0.72"
|
||||
@@ -359,10 +373,19 @@ dependencies = [
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "flate2"
|
||||
version = "1.0.22"
|
||||
name = "fastrand"
|
||||
version = "1.7.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1e6988e897c1c9c485f43b47a529cef42fde0547f9d8d41a7062518f1d8fc53f"
|
||||
checksum = "c3fcf0cee53519c866c09b5de1f6c56ff9d647101f81c1964fa632e148896cdf"
|
||||
dependencies = [
|
||||
"instant",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "flate2"
|
||||
version = "1.0.23"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b39522e96686d38f4bc984b9198e3a0613264abaebaff2c5c918bfa6b6da09af"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"crc32fast",
|
||||
@@ -430,9 +453,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "git2"
|
||||
version = "0.13.25"
|
||||
version = "0.14.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f29229cc1b24c0e6062f6e742aa3e256492a5323365e5ed3413599f8a5eff7d6"
|
||||
checksum = "3826a6e0e2215d7a41c2bfc7c9244123969273f3476b939a226aac0ab56e9e3c"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
"libc",
|
||||
@@ -558,23 +581,17 @@ version = "1.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
|
||||
|
||||
[[package]]
|
||||
name = "lazycell"
|
||||
version = "1.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"
|
||||
|
||||
[[package]]
|
||||
name = "libc"
|
||||
version = "0.2.112"
|
||||
version = "0.2.125"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1b03d17f364a3a042d5e5d46b053bbbf82c92c9430c592dd4c064dc6ee997125"
|
||||
checksum = "5916d2ae698f6de9bfb891ad7a8d65c09d232dc58cc4ac433c7da3b2fd84bc2b"
|
||||
|
||||
[[package]]
|
||||
name = "libgit2-sys"
|
||||
version = "0.12.26+1.3.0"
|
||||
version = "0.13.2+1.4.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "19e1c899248e606fbfe68dcb31d8b0176ebab833b103824af31bddf4b7457494"
|
||||
checksum = "3a42de9a51a5c12e00fc0e4ca6bc2ea43582fc6418488e8f615e905d886f258b"
|
||||
dependencies = [
|
||||
"cc",
|
||||
"libc",
|
||||
@@ -639,36 +656,24 @@ version = "2.4.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a"
|
||||
|
||||
[[package]]
|
||||
name = "memoffset"
|
||||
version = "0.6.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce"
|
||||
dependencies = [
|
||||
"autocfg",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "miniz_oxide"
|
||||
version = "0.4.4"
|
||||
version = "0.5.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4b"
|
||||
checksum = "d2b29bd4bc3f33391105ebee3589c19197c4271e3e5a9ec9bfe8127eeff8f082"
|
||||
dependencies = [
|
||||
"adler",
|
||||
"autocfg",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "nix"
|
||||
version = "0.23.1"
|
||||
version = "0.24.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9f866317acbd3a240710c63f065ffb1e4fd466259045ccb504130b7f668f35c6"
|
||||
checksum = "8f17df307904acd05aa8e32e97bb20f2a0df1728bbc2d771ae8f9a90463441e9"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
"cc",
|
||||
"cfg-if",
|
||||
"libc",
|
||||
"memoffset",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -688,9 +693,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "once_cell"
|
||||
version = "1.9.0"
|
||||
version = "1.10.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "da32515d9f6e6e489d7bc9d84c71b060db7247dc035bbe44eac88cf87486d8d5"
|
||||
checksum = "87f3e037eac156d1775da914196f0f37741a274155e34a0b7e427c35d2a2ecb9"
|
||||
|
||||
[[package]]
|
||||
name = "onig"
|
||||
@@ -774,17 +779,11 @@ dependencies = [
|
||||
"xml-rs",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ppv-lite86"
|
||||
version = "0.2.16"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872"
|
||||
|
||||
[[package]]
|
||||
name = "predicates"
|
||||
version = "2.1.0"
|
||||
version = "2.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "95e5a7689e456ab905c22c2b48225bb921aba7c8dfa58440d68ba13f6222a715"
|
||||
checksum = "a5aab5be6e4732b473071984b3164dbbfb7a3674d30ea5ff44410b6bcd960c3c"
|
||||
dependencies = [
|
||||
"difflib",
|
||||
"float-cmp",
|
||||
@@ -810,6 +809,30 @@ dependencies = [
|
||||
"termtree",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "proc-macro-error"
|
||||
version = "1.0.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c"
|
||||
dependencies = [
|
||||
"proc-macro-error-attr",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
"version_check",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "proc-macro-error-attr"
|
||||
version = "1.0.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"version_check",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "proc-macro-hack"
|
||||
version = "0.5.19"
|
||||
@@ -834,46 +857,6 @@ dependencies = [
|
||||
"proc-macro2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rand"
|
||||
version = "0.8.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2e7573632e6454cf6b99d7aac4ccca54be06da05aca2ef7423d22d27d4d4bcd8"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"rand_chacha",
|
||||
"rand_core",
|
||||
"rand_hc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rand_chacha"
|
||||
version = "0.3.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88"
|
||||
dependencies = [
|
||||
"ppv-lite86",
|
||||
"rand_core",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rand_core"
|
||||
version = "0.6.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7"
|
||||
dependencies = [
|
||||
"getrandom",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rand_hc"
|
||||
version = "0.3.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d51e9f596de227fda2ea6c84607f5558e196eeaf43c986b724ba4fb8fdf497e7"
|
||||
dependencies = [
|
||||
"rand_core",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "redox_syscall"
|
||||
version = "0.2.10"
|
||||
@@ -895,9 +878,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "regex"
|
||||
version = "1.5.4"
|
||||
version = "1.5.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461"
|
||||
checksum = "1a11647b6b25ff05a515cb92c365cec08801e83423a235b51e231e1808747286"
|
||||
dependencies = [
|
||||
"aho-corasick",
|
||||
"memchr",
|
||||
@@ -925,6 +908,45 @@ dependencies = [
|
||||
"winapi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rgb"
|
||||
version = "0.8.31"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9a374af9a0e5fdcdd98c1c7b64f05004f9ea2555b6c75f211daa81268a3c50f1"
|
||||
dependencies = [
|
||||
"bytemuck",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rlua"
|
||||
version = "0.19.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "627ae78424400009e889c43b0c188d0b7af3fe7301b68c03d9cfacb29115408a"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
"bstr",
|
||||
"libc",
|
||||
"num-traits",
|
||||
"rlua-lua54-sys",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rlua-lua54-sys"
|
||||
version = "0.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b4e1fdfc6a5f7acfa1b1fe26c5076b54f5ebd6818b5982460c39844c8b859370"
|
||||
dependencies = [
|
||||
"cc",
|
||||
"libc",
|
||||
"pkg-config",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustversion"
|
||||
version = "1.0.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f2cc38e8fa666e2de3c4aba7edeb5ffc5246c1c2ed0e3d17e560aeeba736b23f"
|
||||
|
||||
[[package]]
|
||||
name = "ryu"
|
||||
version = "1.0.9"
|
||||
@@ -954,24 +976,24 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
|
||||
|
||||
[[package]]
|
||||
name = "semver"
|
||||
version = "1.0.4"
|
||||
version = "1.0.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "568a8e6258aa33c13358f81fd834adb854c6f7c9468520910a9b1e8fac068012"
|
||||
checksum = "d65bd28f48be7196d222d95b9243287f48d27aca604e08497513019ff0502cc4"
|
||||
|
||||
[[package]]
|
||||
name = "serde"
|
||||
version = "1.0.133"
|
||||
version = "1.0.136"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "97565067517b60e2d1ea8b268e59ce036de907ac523ad83a0475da04e818989a"
|
||||
checksum = "ce31e24b01e1e524df96f1c2fdd054405f8d7376249a5110886fb4b658484789"
|
||||
dependencies = [
|
||||
"serde_derive",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "serde_derive"
|
||||
version = "1.0.133"
|
||||
version = "1.0.136"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ed201699328568d8d08208fdd080e3ff594e6c422e438b6705905da01005d537"
|
||||
checksum = "08597e7152fcd306f41838ed3e37be9eaeed2b61c42e2117266a554fab4662f9"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
@@ -1003,9 +1025,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "serial_test"
|
||||
version = "0.5.1"
|
||||
version = "0.6.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e0bccbcf40c8938196944a3da0e133e031a33f4d6b72db3bda3cc556e361905d"
|
||||
checksum = "e5bcc41d18f7a1d50525d080fd3e953be87c4f9f1a974f3c21798ca00d54ec15"
|
||||
dependencies = [
|
||||
"lazy_static",
|
||||
"parking_lot",
|
||||
@@ -1014,12 +1036,14 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "serial_test_derive"
|
||||
version = "0.5.1"
|
||||
version = "0.6.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b2acd6defeddb41eb60bb468f8825d0cfd0c2a76bc03bfd235b6a1dc4f6a1ad5"
|
||||
checksum = "2881bccd7d60fb32dfa3d7b3136385312f8ad75e2674aab2852867a09790cae8"
|
||||
dependencies = [
|
||||
"proc-macro-error",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"rustversion",
|
||||
"syn",
|
||||
]
|
||||
|
||||
@@ -1031,9 +1055,9 @@ checksum = "45bb67a18fa91266cc7807181f62f9178a6873bfad7dc788c42e6430db40184f"
|
||||
|
||||
[[package]]
|
||||
name = "shell-words"
|
||||
version = "1.0.0"
|
||||
version = "1.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b6fa3938c99da4914afedd13bf3d79bcb6c277d1b2c398d23257a304d9e1b074"
|
||||
checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde"
|
||||
|
||||
[[package]]
|
||||
name = "smallvec"
|
||||
@@ -1066,9 +1090,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "syntect"
|
||||
version = "4.6.0"
|
||||
version = "5.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8b20815bbe80ee0be06e6957450a841185fcf690fe0178f14d77a05ce2caa031"
|
||||
checksum = "c6c454c27d9d7d9a84c7803aaa3c50cd088d2906fe3c6e42da3209aa623576a8"
|
||||
dependencies = [
|
||||
"bincode",
|
||||
"bitflags",
|
||||
@@ -1076,13 +1100,14 @@ dependencies = [
|
||||
"flate2",
|
||||
"fnv",
|
||||
"lazy_static",
|
||||
"lazycell",
|
||||
"once_cell",
|
||||
"onig",
|
||||
"plist",
|
||||
"regex-syntax",
|
||||
"serde",
|
||||
"serde_derive",
|
||||
"serde_json",
|
||||
"thiserror",
|
||||
"walkdir",
|
||||
"yaml-rust",
|
||||
]
|
||||
@@ -1099,13 +1124,13 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tempfile"
|
||||
version = "3.2.0"
|
||||
version = "3.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "dac1c663cfc93810f88aed9b8941d48cabf856a1b111c29a40439018d870eb22"
|
||||
checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"fastrand",
|
||||
"libc",
|
||||
"rand",
|
||||
"redox_syscall",
|
||||
"remove_dir_all",
|
||||
"winapi",
|
||||
@@ -1158,18 +1183,18 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "thiserror"
|
||||
version = "1.0.30"
|
||||
version = "1.0.31"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "854babe52e4df1653706b98fcfc05843010039b406875930a70e4d9644e5c417"
|
||||
checksum = "bd829fe32373d27f76265620b5309d0340cb8550f523c1dda251d6298069069a"
|
||||
dependencies = [
|
||||
"thiserror-impl",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "thiserror-impl"
|
||||
version = "1.0.30"
|
||||
version = "1.0.31"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "aa32fd3f627f367fe16f893e2597ae3c05020f8bba2666a4e6ea73d377e5714b"
|
||||
checksum = "0396bc89e626244658bef819e22d0cc459e795a5ebe878e6ec336d1674a8d79a"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
@@ -1252,6 +1277,12 @@ version = "0.8.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191"
|
||||
|
||||
[[package]]
|
||||
name = "version_check"
|
||||
version = "0.9.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
|
||||
|
||||
[[package]]
|
||||
name = "wait-timeout"
|
||||
version = "0.2.0"
|
||||
|
32
Cargo.toml
32
Cargo.toml
@@ -6,7 +6,7 @@ homepage = "https://github.com/sharkdp/bat"
|
||||
license = "MIT/Apache-2.0"
|
||||
name = "bat"
|
||||
repository = "https://github.com/sharkdp/bat"
|
||||
version = "0.19.0"
|
||||
version = "0.21.0"
|
||||
exclude = ["assets/syntaxes/*", "assets/themes/*"]
|
||||
build = "build.rs"
|
||||
edition = '2018'
|
||||
@@ -30,11 +30,11 @@ minimal-application = [
|
||||
"paging",
|
||||
"regex-onig",
|
||||
"wild",
|
||||
"rlua"
|
||||
]
|
||||
git = ["git2"] # Support indicating git modifications
|
||||
paging = ["shell-words", "grep-cli"] # Support applying a pager on the output
|
||||
# Add "syntect/plist-load" when https://github.com/trishume/syntect/pull/345 reaches us
|
||||
build-assets = ["syntect/yaml-load", "syntect/dump-create", "regex", "walkdir"]
|
||||
build-assets = ["syntect/yaml-load", "syntect/plist-load", "regex", "walkdir"]
|
||||
|
||||
# You need to use one of these if you depend on bat as a library:
|
||||
regex-onig = ["syntect/regex-onig"] # Use the "oniguruma" regex engine
|
||||
@@ -43,16 +43,16 @@ regex-fancy = ["syntect/regex-fancy"] # Use the rust-only "fancy-regex" engine
|
||||
[dependencies]
|
||||
atty = { version = "0.2.14", optional = true }
|
||||
ansi_term = "^0.12.1"
|
||||
ansi_colours = "^1.0"
|
||||
ansi_colours = "^1.1"
|
||||
bincode = "1.0"
|
||||
console = "0.15.0"
|
||||
flate2 = "1.0"
|
||||
once_cell = "1.9"
|
||||
once_cell = "1.10"
|
||||
thiserror = "1.0"
|
||||
wild = { version = "2.0", optional = true }
|
||||
content_inspector = "0.2.4"
|
||||
encoding = "0.2"
|
||||
shell-words = { version = "1.0.0", optional = true }
|
||||
shell-words = { version = "1.1.0", optional = true }
|
||||
unicode-width = "0.1.9"
|
||||
globset = "0.4"
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
@@ -60,19 +60,21 @@ serde_yaml = "0.8"
|
||||
semver = "1.0"
|
||||
path_abs = { version = "0.5", default-features = false }
|
||||
clircle = "0.3"
|
||||
bugreport = { version = "0.4", optional = true }
|
||||
bugreport = { version = "0.5.0", optional = true }
|
||||
dirs-next = { version = "2.0.0", optional = true }
|
||||
grep-cli = { version = "0.1.6", optional = true }
|
||||
regex = { version = "1.0", optional = true }
|
||||
regex = { version = "1.5.5", optional = true }
|
||||
walkdir = { version = "2.0", optional = true }
|
||||
bytesize = { version = "1.1.0" }
|
||||
rlua = { version = "0.19", optional = true }
|
||||
|
||||
[dependencies.git2]
|
||||
version = "0.13"
|
||||
version = "0.14"
|
||||
optional = true
|
||||
default-features = false
|
||||
|
||||
[dependencies.syntect]
|
||||
version = "4.6.0"
|
||||
version = "5.0.0"
|
||||
default-features = false
|
||||
features = ["parsing"]
|
||||
|
||||
@@ -83,14 +85,14 @@ default-features = false
|
||||
features = ["suggestions", "color", "wrap_help"]
|
||||
|
||||
[dev-dependencies]
|
||||
assert_cmd = "2.0.2"
|
||||
serial_test = "0.5.1"
|
||||
predicates = "2.1.0"
|
||||
assert_cmd = "2.0.4"
|
||||
serial_test = "0.6.0"
|
||||
predicates = "2.1.1"
|
||||
wait-timeout = "0.2.0"
|
||||
tempfile = "3.2.0"
|
||||
tempfile = "3.3.0"
|
||||
|
||||
[target.'cfg(unix)'.dev-dependencies]
|
||||
nix = "0.23.1"
|
||||
nix = { version = "0.24.1", default-features = false, features = ["term"] }
|
||||
|
||||
[build-dependencies]
|
||||
clap = { version = "2.34", optional = true }
|
||||
|
38
README.md
38
README.md
@@ -19,6 +19,19 @@
|
||||
[<a href="doc/README-ru.md">Русский</a>]
|
||||
</p>
|
||||
|
||||
### Sponsors
|
||||
|
||||
A special *thank you* goes to our biggest <a href="doc/sponsors.md">sponsors</a>:<br>
|
||||
<a href="https://workos.com/?utm_campaign=github_repo&utm_medium=referral&utm_content=bat&utm_source=github">
|
||||
<img src="doc/sponsors/workos-logo-white-bg.svg" width="200" alt="WorkOS">
|
||||
<br>
|
||||
<strong>Your app, enterprise-ready.</strong>
|
||||
<br>
|
||||
<sub>Start selling to enterprise customers with just a few lines of code.</sub>
|
||||
<br>
|
||||
<sup>Add Single Sign-On (and more) in minutes instead of months.</sup>
|
||||
</a>
|
||||
|
||||
### Syntax highlighting
|
||||
|
||||
`bat` supports syntax highlighting for a large number of programming and markup
|
||||
@@ -158,7 +171,7 @@ You can combine `bat` with `git diff` to view lines around code changes with pro
|
||||
highlighting:
|
||||
```bash
|
||||
batdiff() {
|
||||
git diff --name-only --diff-filter=d | xargs bat --diff
|
||||
git diff --name-only --relative --diff-filter=d | xargs bat --diff
|
||||
}
|
||||
```
|
||||
If you prefer to use this as a separate tool, check out `batdiff` in [`bat-extras`](https://github.com/eth-p/bat-extras).
|
||||
@@ -199,6 +212,24 @@ Also, note that this will [not work](https://github.com/sharkdp/bat/issues/1145)
|
||||
|
||||
The [`prettybat`](https://github.com/eth-p/bat-extras/blob/master/doc/prettybat.md) script is a wrapper that will format code and print it with `bat`.
|
||||
|
||||
#### Highlighting `--help` messages
|
||||
|
||||
You can use `bat` to colorize help text: `$ cp --help | bat -plhelp`
|
||||
|
||||
You can also use a wrapper around this:
|
||||
|
||||
```bash
|
||||
# in your .bashrc/.zshrc/*rc
|
||||
alias bathelp='bat --plain --language=help'
|
||||
help() {
|
||||
"$@" --help 2>&1 | bathelp
|
||||
}
|
||||
```
|
||||
|
||||
Then you can do `$ help cp` or `$ help git commit`.
|
||||
|
||||
Please report any issues with the help syntax in [this repository](https://github.com/victor-gp/cmd-help-sublime-syntax).
|
||||
|
||||
|
||||
## Installation
|
||||
|
||||
@@ -515,8 +546,9 @@ command line option. The option takes an argument of the form `pattern:syntax` w
|
||||
the absolute file path. The `syntax` part is the full name of a supported language
|
||||
(use `bat --list-languages` for an overview).
|
||||
|
||||
Note: You probably want to use this option as an entry in `bat`s configuration file instead
|
||||
of passing it on the command line (see below).
|
||||
**Note:** You probably want to use this option as [an entry in `bat`'s configuration file](#configuration-file)
|
||||
for persistence instead of passing it on the command line as a one-off. Generally
|
||||
you'd just use `-l` if you want to manually specify a language for a file.
|
||||
|
||||
Example: To use "INI" syntax highlighting for all files with a `.conf` file extension, use
|
||||
```bash
|
||||
|
BIN
assets/acknowledgements.bin
vendored
BIN
assets/acknowledgements.bin
vendored
Binary file not shown.
2
assets/completions/_bat.ps1.in
vendored
2
assets/completions/_bat.ps1.in
vendored
@@ -37,7 +37,7 @@ Register-ArgumentCompleter -Native -CommandName '{{PROJECT_EXECUTABLE}}' -Script
|
||||
[CompletionResult]::new('-m', 'm', [CompletionResultType]::ParameterName, 'Use the specified syntax for files matching the glob pattern (''*.cpp:C++'').')
|
||||
[CompletionResult]::new('--map-syntax', 'map-syntax', [CompletionResultType]::ParameterName, 'Use the specified syntax for files matching the glob pattern (''*.cpp:C++'').')
|
||||
[CompletionResult]::new('--theme', 'theme', [CompletionResultType]::ParameterName, 'Set the color theme for syntax highlighting.')
|
||||
[CompletionResult]::new('--style', 'style', [CompletionResultType]::ParameterName, 'Comma-separated list of style elements to display (*auto*, full, plain, changes, header, grid, rule, numbers, snip).')
|
||||
[CompletionResult]::new('--style', 'style', [CompletionResultType]::ParameterName, 'Comma-separated list of style elements to display (*default*, auto, full, plain, changes, header, header-filename, header-filesize, grid, rule, numbers, snip).')
|
||||
[CompletionResult]::new('-r', 'r', [CompletionResultType]::ParameterName, 'Only print the lines from N to M.')
|
||||
[CompletionResult]::new('--line-range', 'line-range', [CompletionResultType]::ParameterName, 'Only print the lines from N to M.')
|
||||
[CompletionResult]::new('-A', 'A', [CompletionResultType]::ParameterName, 'Show non-printable characters (space, tab, newline, ..).')
|
||||
|
15
assets/completions/bat.bash.in
vendored
15
assets/completions/bat.bash.in
vendored
@@ -2,9 +2,22 @@
|
||||
|
||||
# Requires https://github.com/scop/bash-completion
|
||||
|
||||
# Macs have bash3 for which the bash-completion package doesn't include
|
||||
# _init_completion. This is a minimal version of that function.
|
||||
__bat_init_completion()
|
||||
{
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref "$@" cur prev words cword
|
||||
}
|
||||
|
||||
_bat() {
|
||||
local cur prev words cword split
|
||||
local cur prev words cword split=false
|
||||
if declare -F _init_completion >/dev/null 2>&1; then
|
||||
_init_completion -s || return 0
|
||||
else
|
||||
__bat_init_completion -n "=" || return 0
|
||||
_split_longopt && split=true
|
||||
fi
|
||||
|
||||
if [[ ${words[1]-} == cache ]]; then
|
||||
case $prev in
|
||||
|
2
assets/completions/bat.fish.in
vendored
2
assets/completions/bat.fish.in
vendored
@@ -56,7 +56,7 @@ complete -c {{PROJECT_EXECUTABLE}} -s P -d "Disable paging. Alias for '--paging=
|
||||
|
||||
complete -c {{PROJECT_EXECUTABLE}} -s A -l show-all -d "Show non-printable characters like space/tab/newline" -n "not __fish_seen_subcommand_from cache"
|
||||
|
||||
complete -c {{PROJECT_EXECUTABLE}} -l style -xka "auto full plain changes header grid rule numbers snip" -d "Comma-separated list of style elements or presets to display with file contents" -n "not __fish_seen_subcommand_from cache"
|
||||
complete -c {{PROJECT_EXECUTABLE}} -l style -xka "default auto full plain changes header header-filename header-filesize grid rule numbers snip" -d "Comma-separated list of style elements or presets to display with file contents" -n "not __fish_seen_subcommand_from cache"
|
||||
|
||||
complete -c {{PROJECT_EXECUTABLE}} -l tabs -x -d "<T> Set the tab width to T spaces (width of 0 passes tabs through directly)" -n "not __fish_seen_subcommand_from cache"
|
||||
|
||||
|
2
assets/completions/bat.zsh.in
vendored
2
assets/completions/bat.zsh.in
vendored
@@ -75,7 +75,7 @@ _{{PROJECT_EXECUTABLE}}_main() {
|
||||
;;
|
||||
|
||||
style)
|
||||
_values -s , 'style' auto full plain changes header grid rule numbers snip
|
||||
_values -s , 'style' default auto full plain changes header header-filename header-filesize grid rule numbers snip
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
3
assets/manual/bat.1.in
vendored
3
assets/manual/bat.1.in
vendored
@@ -146,7 +146,8 @@ Configure which elements (line numbers, file headers, grid borders, Git modifica
|
||||
of components to display (e.g. 'numbers,changes,grid') or a pre\-defined style ('full').
|
||||
To set a default style, add the '\-\-style=".."' option to the configuration file or
|
||||
export the BAT_STYLE environment variable (e.g.: export BAT_STYLE=".."). Possible
|
||||
values: *full*, auto, plain, changes, header, grid, rule, numbers, snip.
|
||||
values: *default*, full, auto, plain, changes, header, header-filename, header-filesize, grid,
|
||||
rule, numbers, snip.
|
||||
.HP
|
||||
\fB\-r\fR, \fB\-\-line\-range\fR <N:M>...
|
||||
.IP
|
||||
|
BIN
assets/syntaxes.bin
vendored
BIN
assets/syntaxes.bin
vendored
Binary file not shown.
2
assets/syntaxes/02_Extra/Fish
vendored
2
assets/syntaxes/02_Extra/Fish
vendored
Submodule assets/syntaxes/02_Extra/Fish updated: 2c254cc851...98316d4332
2
assets/syntaxes/02_Extra/GLSL
vendored
2
assets/syntaxes/02_Extra/GLSL
vendored
Submodule assets/syntaxes/02_Extra/GLSL updated: 4cd4acfffc...59a5f8a312
2
assets/syntaxes/02_Extra/GraphQL
vendored
2
assets/syntaxes/02_Extra/GraphQL
vendored
Submodule assets/syntaxes/02_Extra/GraphQL updated: 59304d6c7b...9b6f6d0a86
4
assets/syntaxes/02_Extra/INI.sublime-syntax
vendored
4
assets/syntaxes/02_Extra/INI.sublime-syntax
vendored
@@ -5,8 +5,8 @@ name: INI
|
||||
file_extensions:
|
||||
- ini
|
||||
- INI
|
||||
- inf
|
||||
- INF
|
||||
- "inf"
|
||||
- "INF"
|
||||
- reg
|
||||
- REG
|
||||
- lng
|
||||
|
2
assets/syntaxes/02_Extra/Nginx
vendored
2
assets/syntaxes/02_Extra/Nginx
vendored
Submodule assets/syntaxes/02_Extra/Nginx updated: 15a1db1510...65f5a63c0d
@@ -197,7 +197,7 @@ contexts:
|
||||
scope: entity.other.attribute-name.stylus
|
||||
- match: |-
|
||||
(?x) # multi-line regex definition mode
|
||||
(?<=^|;|{)\s* # starts after begining of line, '{' or ';''
|
||||
(?<=^|;|{)\s* # starts after beginning of line, '{' or ';''
|
||||
(?= # lookahead for
|
||||
(
|
||||
[a-zA-Z0-9_-] # then a letter
|
||||
@@ -207,7 +207,7 @@ contexts:
|
||||
(/\*.*?\*/) # comment
|
||||
)+
|
||||
|
||||
\s*[:\s]\s* # value is separted by colon or space
|
||||
\s*[:\s]\s* # value is separated by colon or space
|
||||
|
||||
(?!(\s*\{)) # if there are only spaces afterwards
|
||||
|
||||
|
1
assets/syntaxes/02_Extra/SublimeJQ
vendored
Submodule
1
assets/syntaxes/02_Extra/SublimeJQ
vendored
Submodule
Submodule assets/syntaxes/02_Extra/SublimeJQ added at 687058289c
2
assets/syntaxes/02_Extra/TOML
vendored
2
assets/syntaxes/02_Extra/TOML
vendored
Submodule assets/syntaxes/02_Extra/TOML updated: 6bfcc3c236...ed38438900
2
assets/syntaxes/02_Extra/VimL
vendored
2
assets/syntaxes/02_Extra/VimL
vendored
Submodule assets/syntaxes/02_Extra/VimL updated: c91fe3ab02...ee85822cbe
2
assets/syntaxes/02_Extra/Zig
vendored
2
assets/syntaxes/02_Extra/Zig
vendored
Submodule assets/syntaxes/02_Extra/Zig updated: 87ecbcae6f...1a4a38445f
1
assets/syntaxes/02_Extra/cmd-help
vendored
Submodule
1
assets/syntaxes/02_Extra/cmd-help
vendored
Submodule
Submodule assets/syntaxes/02_Extra/cmd-help added at 1e513f5f19
36
assets/syntaxes/02_Extra/log.sublime-syntax
vendored
36
assets/syntaxes/02_Extra/log.sublime-syntax
vendored
@@ -6,6 +6,7 @@ file_extensions:
|
||||
scope: text.log
|
||||
variables:
|
||||
ipv4_part: (?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)
|
||||
hours_minutes_seconds: (?:[01]\d|2[0-3]):(?:[0-5]\d):(?:[0-5]\d)
|
||||
contexts:
|
||||
main:
|
||||
- match: (\w+)(=)
|
||||
@@ -17,11 +18,10 @@ contexts:
|
||||
captures:
|
||||
1: punctuation.definition.string.begin.log
|
||||
3: punctuation.definition.string.end.log
|
||||
- match: (")([^"]*)(")
|
||||
scope: string.quoted.double.log
|
||||
- match: \"
|
||||
captures:
|
||||
1: punctuation.definition.string.begin.log
|
||||
3: punctuation.definition.string.end.log
|
||||
push: double_quoted_string
|
||||
- include: dates
|
||||
- include: ip_addresses
|
||||
- include: numbers
|
||||
@@ -29,19 +29,34 @@ contexts:
|
||||
scope: markup.error.log
|
||||
- match: \b(?i:warn(?:ing)?)\b
|
||||
scope: markup.warning.log
|
||||
- match: \b(?i:debug)\b
|
||||
scope: markup.info.log
|
||||
#- include: scope:text.html.markdown#autolink-inet
|
||||
- match: \b\w+:/{2,3}
|
||||
scope: markup.underline.link.scheme.log
|
||||
push: url-host
|
||||
dates:
|
||||
- match: \b\d{4}-\d{2}-\d{2}\b
|
||||
- match: \b\d{4}-\d{2}-\d{2}(?=\b|T)
|
||||
scope: meta.date.log meta.number.integer.decimal.log constant.numeric.value.log
|
||||
- match: \b\d{4}/\d{2}/\d{2}\b
|
||||
push: maybe_date_time_separator
|
||||
- match: \b\d{4}/\d{2}/\d{2}(?=\b|T)
|
||||
scope: meta.date.log meta.number.integer.decimal.log constant.numeric.value.log
|
||||
- match: \b(?:[01]\d|2[0-3]):(?:[0-5]\d):(?:[0-5]\d)(?:(\.)\d{3})?\b
|
||||
push: maybe_date_time_separator
|
||||
- match: \b(?={{hours_minutes_seconds}})
|
||||
push: time
|
||||
time:
|
||||
- match: (?:{{hours_minutes_seconds}})(?:(\.)\d{3})?\b
|
||||
scope: meta.time.log meta.number.integer.decimal.log constant.numeric.value.log
|
||||
captures:
|
||||
1: punctuation.separator.decimal.log
|
||||
- match: ''
|
||||
pop: true
|
||||
maybe_date_time_separator:
|
||||
- match: T(?={{hours_minutes_seconds}})
|
||||
scope: meta.date.log meta.time.log keyword.other.log
|
||||
set: time
|
||||
- match: ''
|
||||
pop: true
|
||||
ip_addresses:
|
||||
- match: \b(?=(?:{{ipv4_part}}\.){3}{{ipv4_part}}\b)
|
||||
push:
|
||||
@@ -114,3 +129,12 @@ contexts:
|
||||
scope: markup.underline.link.path.log
|
||||
- match: ''
|
||||
pop: true
|
||||
double_quoted_string:
|
||||
- meta_scope: string.quoted.double.log
|
||||
- match: \\"
|
||||
scope: constant.character.escape.log
|
||||
- match: \\n
|
||||
scope: constant.character.escape.log
|
||||
- match: \"
|
||||
scope: punctuation.definition.string.end.log
|
||||
pop: true
|
||||
|
BIN
assets/themes.bin
vendored
BIN
assets/themes.bin
vendored
Binary file not shown.
@@ -181,7 +181,7 @@ man 2 select
|
||||
|
||||
## インストール
|
||||
|
||||
[](https://repology.org/project/bat/versions)
|
||||
[](https://repology.org/project/bat-cat/versions)
|
||||
|
||||
### On Ubuntu (`apt` を使用)
|
||||
*... や他のDebianベースのLinuxディストリビューション*
|
||||
|
@@ -222,7 +222,7 @@ man 2 select
|
||||
`bat`은 [Ubuntu](https://packages.ubuntu.com/eoan/bat)와
|
||||
[Debian](https://packages.debian.org/sid/bat) 패키지 배포 과정에 도입되는 중이며,
|
||||
Eoan 19.10 버전의 Ubuntu에서부터 제공됩니다.
|
||||
현재 Debain에서는 불안정한 "Sid" 브랜치에서만 `bat`이 제공됩니다.
|
||||
현재 Debian에서는 불안정한 "Sid" 브랜치에서만 `bat`이 제공됩니다.
|
||||
|
||||
만약 충분히 최신 버전의 Ubuntu/Debian이 설치되어 있다면 간단히 다음을 실행하세요:
|
||||
|
||||
|
@@ -160,7 +160,7 @@ man 2 select
|
||||
|
||||
## Установка
|
||||
|
||||
[](https://repology.org/project/bat/versions)
|
||||
[](https://repology.org/project/bat-cat/versions)
|
||||
|
||||
### Ubuntu (с помощью `apt`)
|
||||
*... и другие дистрибутивы основанные на Debian.*
|
||||
|
@@ -1,16 +1,5 @@
|
||||
# Release checklist
|
||||
|
||||
## Dependencies
|
||||
|
||||
See this page for a good overview: https://deps.rs/repo/github/sharkdp/bat
|
||||
|
||||
- [ ] Optional: update dependencies with `cargo update`. This is also done by
|
||||
dependabot, so it is not strictly necessary.
|
||||
- [ ] Install [cargo-outdated](https://crates.io/crates/cargo-outdated). Check
|
||||
for outdated dependencies with `cargo outdated --root-deps-only` and
|
||||
decide for each of them whether we want to (manually) upgrade. This will
|
||||
require changes to `Cargo.toml`.
|
||||
|
||||
## Version bump
|
||||
|
||||
- [ ] Update version in `Cargo.toml`. Run `cargo build` to update `Cargo.lock`.
|
||||
@@ -18,21 +7,22 @@ See this page for a good overview: https://deps.rs/repo/github/sharkdp/bat
|
||||
- [ ] Find the current min. supported Rust version by running
|
||||
`grep '^\s*MIN_SUPPORTED_RUST_VERSION' .github/workflows/CICD.yml`.
|
||||
- [ ] Update the version and the min. supported Rust version in `README.md` and
|
||||
`doc/README-*.md`. Check with `git grep -i 'rust.*1\.'` and
|
||||
`git grep -i '1\..*rust'`.
|
||||
`doc/README-*.md`. Check with
|
||||
`git grep -i -e 'rust.*1\.' -e '1\..*rust' | grep README | grep -v tests/`.
|
||||
- [ ] Update `CHANGELOG.md`. Introduce a section for the new release.
|
||||
|
||||
## Update syntaxes and themes (build assets)
|
||||
|
||||
- [ ] Install the latest master version (`cargo install -f --path .`) and make
|
||||
- [ ] Install the latest master version (`cargo clean && cargo install --locked -f --path .`) and make
|
||||
sure that it is available on the `PATH` (`bat --version` should show the
|
||||
new version).
|
||||
- [ ] Run `assets/create.sh` and check in the binary asset files.
|
||||
|
||||
## Documentation
|
||||
|
||||
- [ ] Review the `-h` and `--help` texts
|
||||
- [ ] Review the `man` page
|
||||
- [ ] Review `-h`, `--help`, and the `man` page. All of these are shown in
|
||||
the output of the CI job called *Documentation*, so look there.
|
||||
The CI workflow corresponding to the tip of the master branch is a good place to look.
|
||||
|
||||
## Pre-release checks
|
||||
|
||||
@@ -41,13 +31,14 @@ See this page for a good overview: https://deps.rs/repo/github/sharkdp/bat
|
||||
- [ ] Optional: manually test the new features and command-line options. To do
|
||||
this, install the latest `bat` version again (to include the new syntaxes
|
||||
and themes).
|
||||
- [ ] Run `cargo publish --dry-run --allow-dirty` to make sure that it will
|
||||
- [ ] Run `cargo publish --dry-run` to make sure that it will
|
||||
succeed later (after creating the GitHub release).
|
||||
|
||||
## Release
|
||||
|
||||
- [ ] Create a tag and push it: `git tag vX.Y.Z; git push origin tag vX.Y.Z`.
|
||||
This will trigger the deployment via GitHub Actions.
|
||||
REMINDER: If your `origin` is a fork, don't forget to push to e.g. `upstream` instead!
|
||||
- [ ] Go to https://github.com/sharkdp/bat/releases/new to create the new
|
||||
release. Select the new tag and also use it as the release title. For the
|
||||
release notes, copy the corresponding section from `CHANGELOG.md` and
|
||||
@@ -60,4 +51,23 @@ See this page for a good overview: https://deps.rs/repo/github/sharkdp/bat
|
||||
|
||||
## Post-release
|
||||
|
||||
- [ ] Prepare a new (empty) "unreleased" section at the top of `CHANGELOG.md`.
|
||||
- [ ] Prepare a new "unreleased" section at the top of `CHANGELOG.md`.
|
||||
Put this at the top:
|
||||
|
||||
```
|
||||
# unreleased
|
||||
|
||||
## Features
|
||||
|
||||
## Bugfixes
|
||||
|
||||
## Other
|
||||
|
||||
## Syntaxes
|
||||
|
||||
## Themes
|
||||
|
||||
## `bat` as a library
|
||||
|
||||
|
||||
```
|
14
doc/sponsors.md
Normal file
14
doc/sponsors.md
Normal file
@@ -0,0 +1,14 @@
|
||||
## Sponsors
|
||||
|
||||
`bat` development is sponsored by many individuals and companies. Thank you very much!
|
||||
|
||||
Please note, that being sponsored does not affect the individuality of the `bat`
|
||||
project or affect the maintainers' actions in any way.
|
||||
We remain impartial and continue to assess pull requests solely on merit - the
|
||||
features added, bugs solved, and effect on the overall complexity of the code.
|
||||
No issue will have a different priority based on sponsorship status of the
|
||||
reporter.
|
||||
|
||||
Contributions from anybody are most welcomed, please see our [`CONTRIBUTING.md`](../CONTRIBUTING.md) guide.
|
||||
|
||||
If you want to see our biggest sponsors, check the top of [`README.md`](../README.md#sponsors).
|
11
doc/sponsors/workos-logo-white-bg.svg
Normal file
11
doc/sponsors/workos-logo-white-bg.svg
Normal file
@@ -0,0 +1,11 @@
|
||||
<svg width="1354" height="420" viewBox="0 0 1354 420" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<rect width="1354" height="420" rx="20" fill="white"/>
|
||||
<path d="M434.751 133.122H466.637L489.595 227.729C493.852 245.585 494.697 256.219 494.697 256.219H495.128C495.128 256.219 496.61 245.808 500.867 227.729L522.757 133.122H558.9L582.066 227.729C586.53 246.223 587.598 256.219 587.598 256.219H588.236C588.236 256.219 588.666 246.223 592.907 227.729L615.02 133.122H646.907L606.523 288.313H571.017L546.576 194.344C541.474 173.936 541.044 164.801 541.044 164.801H540.614C540.614 164.801 540.183 173.936 535.512 194.344L512.553 288.313H475.996L434.751 133.122Z" fill="black"/>
|
||||
<path d="M641.583 231.934C641.583 196.428 664.541 173.47 699.202 173.47C733.639 173.47 756.597 196.428 756.597 231.934C756.597 267.647 733.639 290.828 699.202 290.828C664.557 290.812 641.583 267.647 641.583 231.934ZM726.832 231.934C726.832 208.976 715.783 195.998 699.202 195.998C681.346 195.998 671.349 210.458 671.349 231.934C671.349 255.323 682.398 268.284 699.202 268.284C717.058 268.284 726.832 253.824 726.832 231.934Z" fill="black"/>
|
||||
<path d="M770.836 175.21H799.103V196.048H799.741C804.635 185.207 816.322 174.365 836.299 174.365C839.695 174.365 841.831 174.796 843.314 175.21V203.478H842.469C842.469 203.478 839.918 202.633 832.903 202.633C811.013 202.633 799.103 215.594 799.103 239.828V288.295H770.836V175.21Z" fill="black"/>
|
||||
<path d="M856.5 133.122H884.767V182.865C884.767 212.2 884.336 217.509 884.336 217.509H884.767L926.857 175.212H962.139L912.843 224.11L970.031 288.313H936.646L895.401 241.536L884.767 251.946V288.297H856.5V133.122Z" fill="black"/>
|
||||
<path d="M970.444 211.285C970.444 163.455 1000.21 131.569 1044.85 131.569C1089.49 131.569 1119.26 163.455 1119.26 211.285C1119.26 259.114 1089.49 291.001 1044.85 291.001C1000.21 291.001 970.444 259.114 970.444 211.285ZM1088.42 211.285C1088.42 178.761 1071 156.855 1044.84 156.855C1018.67 156.855 1001.26 178.761 1001.26 211.285C1001.26 243.809 1018.69 265.715 1044.84 265.715C1070.98 265.715 1088.42 243.809 1088.42 211.285Z" fill="black"/>
|
||||
<path d="M1130.08 236.656H1162.4C1162.4 254.943 1174.95 265.146 1194.08 265.146C1210.23 265.146 1221.29 257.063 1221.29 245.584C1221.29 232.622 1212.79 229.21 1185.79 223.901C1161.12 219.007 1134.98 210.716 1134.98 178.399C1134.98 151.408 1157.93 131 1193.01 131C1229.57 131 1252.11 150.132 1252.11 179.037H1219.79C1219.79 165.007 1208.95 156.286 1193.01 156.286C1176.86 156.286 1166.86 164.146 1166.86 175.625C1166.86 187.742 1173.88 192.413 1195.56 196.878C1227.65 203.685 1254.02 207.288 1254.02 243.001C1254.02 271.3 1229.36 290.432 1193.01 290.432C1156.02 290.432 1130.08 268.957 1130.08 236.656Z" fill="black"/>
|
||||
<path d="M100 210C100 214.824 101.269 219.647 103.723 223.793L148.231 300.878C152.8 308.747 159.739 315.178 168.369 318.055C185.377 323.724 202.977 316.447 211.354 301.893L222.1 283.278L179.708 210L224.47 132.408L235.216 113.792C238.431 108.208 242.747 103.638 247.824 100H243.17H178.777C166.677 100 155.508 106.431 149.5 116.923L103.723 196.208C101.269 200.354 100 205.177 100 210Z" fill="#6363F1"/>
|
||||
<path d="M353.847 210C353.847 205.177 352.578 200.353 350.124 196.207L305.024 118.107C296.647 103.638 279.047 96.3608 262.039 101.945C253.409 104.822 246.47 111.253 241.901 119.122L231.747 136.638L274.139 210L229.378 287.592L218.632 306.208C215.416 311.708 211.101 316.362 206.024 320H210.678H275.07C287.17 320 298.34 313.569 304.347 303.077L350.124 223.792C352.578 219.646 353.847 214.823 353.847 210Z" fill="#6363F1"/>
|
||||
</svg>
|
After Width: | Height: | Size: 3.4 KiB |
21
plugins/curl.lua
Normal file
21
plugins/curl.lua
Normal file
@@ -0,0 +1,21 @@
|
||||
function tempdir()
|
||||
local stream = assert(io.popen('mktemp --directory'))
|
||||
local output = stream:read('*all')
|
||||
stream:close()
|
||||
return string.gsub(output, "\n", "")
|
||||
end
|
||||
|
||||
function preprocess(path_or_url)
|
||||
filename_from_url = string.match(path_or_url, '^https?://.*/(.*)$')
|
||||
if filename_from_url then
|
||||
local temp_directory = tempdir()
|
||||
local new_path = temp_directory .. "/" .. filename_from_url
|
||||
|
||||
-- TODO: how to prevent shell injection bugs?
|
||||
os.execute("curl --silent '" .. path_or_url .. "' --output '" .. new_path .. "'")
|
||||
|
||||
return new_path
|
||||
else
|
||||
return path_or_url
|
||||
end
|
||||
end
|
17
plugins/directories.lua
Normal file
17
plugins/directories.lua
Normal file
@@ -0,0 +1,17 @@
|
||||
-- https://stackoverflow.com/a/3254007/704831
|
||||
function is_dir(path)
|
||||
local f = io.open(path, "r")
|
||||
local ok, err, code = f:read(1)
|
||||
f:close()
|
||||
return code == 21
|
||||
end
|
||||
|
||||
function preprocess(path)
|
||||
if is_dir(path) then
|
||||
tmpfile = os.tmpname()
|
||||
os.execute("ls -alh --color=always '" .. path .. "' > '" .. tmpfile .. "'")
|
||||
return tmpfile
|
||||
else
|
||||
return path
|
||||
end
|
||||
end
|
21
plugins/hexyl.lua
Normal file
21
plugins/hexyl.lua
Normal file
@@ -0,0 +1,21 @@
|
||||
-- Note: this plugin depends on the existence of 'inspect' [1] and 'hexyl' [2]
|
||||
--
|
||||
-- [1] https://github.com/sharkdp/content_inspector
|
||||
-- [2] https://github.com/sharkdp/hexyl
|
||||
|
||||
function is_binary(path)
|
||||
local stream = assert(io.popen("inspect '" .. path .. "'"))
|
||||
local output = stream:read('*all')
|
||||
stream:close()
|
||||
return string.find(output, ": binary\n")
|
||||
end
|
||||
|
||||
function preprocess(path)
|
||||
if is_binary(path) then
|
||||
tmpfile = os.tmpname()
|
||||
os.execute("hexyl --length 1024 --no-position --border=none --no-squeezing '" .. path .. "' > '" .. tmpfile .. "'")
|
||||
return tmpfile
|
||||
else
|
||||
return path
|
||||
end
|
||||
end
|
21
plugins/uncompress.lua
Normal file
21
plugins/uncompress.lua
Normal file
@@ -0,0 +1,21 @@
|
||||
function tempdir()
|
||||
local stream = assert(io.popen('mktemp --directory'))
|
||||
local output = stream:read('*all')
|
||||
stream:close()
|
||||
return string.gsub(output, "\n", "")
|
||||
end
|
||||
|
||||
function preprocess(path)
|
||||
prefix = string.match(path, '^(.*)%.gz$')
|
||||
if prefix then
|
||||
local temp_directory = tempdir()
|
||||
local new_path = temp_directory .. "/" .. prefix
|
||||
|
||||
-- TODO: how to prevent shell injection bugs?
|
||||
os.execute("gunzip < '" .. path .. "' > '" .. new_path .. "'")
|
||||
|
||||
return new_path
|
||||
else
|
||||
return path
|
||||
end
|
||||
end
|
1
rustfmt.toml
Normal file
1
rustfmt.toml
Normal file
@@ -0,0 +1 @@
|
||||
# Defaults are used
|
@@ -43,8 +43,9 @@ pub struct SyntaxReferenceInSet<'a> {
|
||||
pub syntax_set: &'a SyntaxSet,
|
||||
}
|
||||
|
||||
/// Compress for size of ~700 kB instead of ~4600 kB at the cost of ~30% longer deserialization time
|
||||
pub(crate) const COMPRESS_SYNTAXES: bool = true;
|
||||
/// Lazy-loaded syntaxes are already compressed, and we don't want to compress
|
||||
/// already compressed data.
|
||||
pub(crate) const COMPRESS_SYNTAXES: bool = false;
|
||||
|
||||
/// We don't want to compress our [LazyThemeSet] since the lazy-loaded themes
|
||||
/// within it are already compressed, and compressing another time just makes
|
||||
@@ -68,10 +69,57 @@ impl HighlightingAssets {
|
||||
}
|
||||
}
|
||||
|
||||
/// The default theme.
|
||||
///
|
||||
/// ### Windows and Linux
|
||||
///
|
||||
/// Windows and most Linux distributions has a dark terminal theme by
|
||||
/// default. On these platforms, this function always returns a theme that
|
||||
/// looks good on a dark background.
|
||||
///
|
||||
/// ### macOS
|
||||
///
|
||||
/// On macOS the default terminal background is light, but it is common that
|
||||
/// Dark Mode is active, which makes the terminal background dark. On this
|
||||
/// platform, the default theme depends on
|
||||
/// ```bash
|
||||
/// defaults read -globalDomain AppleInterfaceStyle
|
||||
/// ````
|
||||
/// To avoid the overhead of the check on macOS, simply specify a theme
|
||||
/// explicitly via `--theme`, `BAT_THEME`, or `~/.config/bat`.
|
||||
///
|
||||
/// See <https://github.com/sharkdp/bat/issues/1746> and
|
||||
/// <https://github.com/sharkdp/bat/issues/1928> for more context.
|
||||
pub fn default_theme() -> &'static str {
|
||||
#[cfg(not(target_os = "macos"))]
|
||||
{
|
||||
Self::default_dark_theme()
|
||||
}
|
||||
#[cfg(target_os = "macos")]
|
||||
{
|
||||
if macos_dark_mode_active() {
|
||||
Self::default_dark_theme()
|
||||
} else {
|
||||
Self::default_light_theme()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The default theme that looks good on a dark background.
|
||||
*/
|
||||
fn default_dark_theme() -> &'static str {
|
||||
"Monokai Extended"
|
||||
}
|
||||
|
||||
/**
|
||||
* The default theme that looks good on a light background.
|
||||
*/
|
||||
#[cfg(target_os = "macos")]
|
||||
fn default_light_theme() -> &'static str {
|
||||
"Monokai Extended Light"
|
||||
}
|
||||
|
||||
pub fn from_cache(cache_path: &Path) -> Result<Self> {
|
||||
Ok(HighlightingAssets::new(
|
||||
SerializedSyntaxSet::FromFile(cache_path.join("syntaxes.bin")),
|
||||
@@ -90,7 +138,8 @@ impl HighlightingAssets {
|
||||
self.fallback_theme = Some(theme);
|
||||
}
|
||||
|
||||
fn get_syntax_set(&self) -> Result<&SyntaxSet> {
|
||||
/// Return the collection of syntect syntax definitions.
|
||||
pub fn get_syntax_set(&self) -> Result<&SyntaxSet> {
|
||||
self.syntax_set_cell
|
||||
.get_or_try_init(|| self.serialized_syntax_set.deserialize())
|
||||
}
|
||||
@@ -186,7 +235,8 @@ impl HighlightingAssets {
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn get_theme(&self, theme: &str) -> &Theme {
|
||||
/// Look up a syntect theme by name.
|
||||
pub fn get_theme(&self, theme: &str) -> &Theme {
|
||||
match self.get_theme_set().get(theme) {
|
||||
Some(theme) => theme,
|
||||
None => {
|
||||
@@ -349,6 +399,16 @@ fn asset_from_cache<T: serde::de::DeserializeOwned>(
|
||||
.map_err(|_| format!("Could not parse cached {}", description).into())
|
||||
}
|
||||
|
||||
#[cfg(target_os = "macos")]
|
||||
fn macos_dark_mode_active() -> bool {
|
||||
let mut defaults_cmd = std::process::Command::new("defaults");
|
||||
defaults_cmd.args(&["read", "-globalDomain", "AppleInterfaceStyle"]);
|
||||
match defaults_cmd.output() {
|
||||
Ok(output) => output.stdout == b"Dark\n",
|
||||
Err(_) => true,
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
@@ -579,13 +639,22 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn syntax_detection_is_case_sensitive() {
|
||||
fn syntax_detection_is_case_insensitive() {
|
||||
let mut test = SyntaxDetectionTest::new();
|
||||
|
||||
assert_ne!(test.syntax_for_file("README.MD"), "Markdown");
|
||||
assert_eq!(test.syntax_for_file("README.md"), "Markdown");
|
||||
assert_eq!(test.syntax_for_file("README.mD"), "Markdown");
|
||||
assert_eq!(test.syntax_for_file("README.Md"), "Markdown");
|
||||
assert_eq!(test.syntax_for_file("README.MD"), "Markdown");
|
||||
|
||||
// Adding a mapping for "MD" in addition to "md" should not break the mapping
|
||||
test.syntax_mapping
|
||||
.insert("*.MD", MappingTarget::MapTo("Markdown"))
|
||||
.ok();
|
||||
|
||||
assert_eq!(test.syntax_for_file("README.md"), "Markdown");
|
||||
assert_eq!(test.syntax_for_file("README.mD"), "Markdown");
|
||||
assert_eq!(test.syntax_for_file("README.Md"), "Markdown");
|
||||
assert_eq!(test.syntax_for_file("README.MD"), "Markdown");
|
||||
}
|
||||
|
||||
|
@@ -104,6 +104,9 @@ fn license_not_needed_in_acknowledgements(license_text: &str) -> bool {
|
||||
// Public domain
|
||||
"This is free and unencumbered software released into the public domain.",
|
||||
|
||||
// Public domain with stronger wording than above
|
||||
"DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE",
|
||||
|
||||
// Special license of assets/syntaxes/01_Packages/LICENSE
|
||||
"Permission to copy, use, modify, sell and distribute this software is granted. This software is provided \"as is\" without express or implied warranty, and with no claim as to its suitability for any purpose."
|
||||
];
|
||||
|
@@ -241,6 +241,11 @@ impl App {
|
||||
.map(HighlightedLineRanges)
|
||||
.unwrap_or_default(),
|
||||
use_custom_assets: !self.matches.is_present("no-custom-assets"),
|
||||
plugins: self
|
||||
.matches
|
||||
.values_of_os("load-plugin")
|
||||
.unwrap_or_default()
|
||||
.collect(),
|
||||
})
|
||||
}
|
||||
|
||||
@@ -322,7 +327,7 @@ impl App {
|
||||
.collect::<Vec<_>>()
|
||||
})
|
||||
.or(env_style_components)
|
||||
.unwrap_or_else(|| vec![StyleComponent::Full])
|
||||
.unwrap_or_else(|| vec![StyleComponent::Default])
|
||||
.into_iter()
|
||||
.map(|style| style.components(self.interactive_output))
|
||||
.fold(HashSet::new(), |mut acc, components| {
|
||||
|
@@ -396,11 +396,20 @@ pub fn build_app(interactive_output: bool) -> ClapApp<'static, 'static> {
|
||||
.validator(|val| {
|
||||
let mut invalid_vals = val.split(',').filter(|style| {
|
||||
!&[
|
||||
"auto", "full", "plain", "header", "grid", "rule", "numbers", "snip",
|
||||
"auto",
|
||||
"full",
|
||||
"default",
|
||||
"plain",
|
||||
"header",
|
||||
"header-filename",
|
||||
"header-filesize",
|
||||
"grid",
|
||||
"rule",
|
||||
"numbers",
|
||||
"snip",
|
||||
#[cfg(feature = "git")]
|
||||
"changes",
|
||||
]
|
||||
.contains(style)
|
||||
].contains(style)
|
||||
});
|
||||
|
||||
if let Some(invalid) = invalid_vals.next() {
|
||||
@@ -411,7 +420,7 @@ pub fn build_app(interactive_output: bool) -> ClapApp<'static, 'static> {
|
||||
})
|
||||
.help(
|
||||
"Comma-separated list of style elements to display \
|
||||
(*auto*, full, plain, changes, header, grid, rule, numbers, snip).",
|
||||
(*default*, auto, full, plain, changes, header, header-filename, header-filesize, grid, rule, numbers, snip).",
|
||||
)
|
||||
.long_help(
|
||||
"Configure which elements (line numbers, file headers, grid \
|
||||
@@ -422,11 +431,14 @@ pub fn build_app(interactive_output: bool) -> ClapApp<'static, 'static> {
|
||||
'--style=\"..\"' option to the configuration file or export the \
|
||||
BAT_STYLE environment variable (e.g.: export BAT_STYLE=\"..\").\n\n\
|
||||
Possible values:\n\n \
|
||||
* full: enables all available components (default).\n \
|
||||
* auto: same as 'full', unless the output is piped.\n \
|
||||
* default: enables recommended style components (default).\n \
|
||||
* full: enables all available components.\n \
|
||||
* auto: same as 'default', unless the output is piped.\n \
|
||||
* plain: disables all available components.\n \
|
||||
* changes: show Git modification markers.\n \
|
||||
* header: show filenames before the content.\n \
|
||||
* header: alias for 'header-filename'.\n \
|
||||
* header-filename: show filenames before the content.\n \
|
||||
* header-filesize: show file sizes before the content.\n \
|
||||
* grid: vertical/horizontal lines to separate side bar\n \
|
||||
and the header from the content.\n \
|
||||
* rule: horizontal lines to delimit files.\n \
|
||||
@@ -462,6 +474,16 @@ pub fn build_app(interactive_output: bool) -> ClapApp<'static, 'static> {
|
||||
.help("Display all supported languages.")
|
||||
.long_help("Display a list of supported languages for syntax highlighting."),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("load-plugin")
|
||||
.long("load-plugin")
|
||||
.multiple(true)
|
||||
.takes_value(true)
|
||||
.number_of_values(1)
|
||||
.value_name("name")
|
||||
.help("Load plugin with specified name.")
|
||||
.hidden_short_help(true)
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("unbuffered")
|
||||
.short("u")
|
||||
|
@@ -91,7 +91,7 @@ pub fn get_args_from_config_file() -> Result<Vec<OsString>, shell_words::ParseEr
|
||||
.ok()
|
||||
.map(|content| get_args_from_str(&content))
|
||||
.transpose()?
|
||||
.unwrap_or_else(Vec::new))
|
||||
.unwrap_or_default())
|
||||
}
|
||||
|
||||
pub fn get_args_from_env_var() -> Option<Result<Vec<OsString>, shell_words::ParseError>> {
|
||||
|
@@ -8,6 +8,7 @@ mod directories;
|
||||
mod input;
|
||||
|
||||
use std::collections::{HashMap, HashSet};
|
||||
use std::ffi::OsStr;
|
||||
use std::io;
|
||||
use std::io::{BufReader, Write};
|
||||
use std::path::Path;
|
||||
@@ -218,7 +219,66 @@ pub fn list_themes(cfg: &Config) -> Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn run_controller(inputs: Vec<Input>, config: &Config) -> Result<bool> {
|
||||
fn load_and_run_preprocess_plugins(plugins: &[&OsStr], inputs: &mut Vec<Input>) -> Result<()> {
|
||||
use bat::input::InputKind;
|
||||
use rlua::{Function, Lua, Result as LuaResult};
|
||||
use std::fs;
|
||||
use std::path::PathBuf;
|
||||
|
||||
if plugins.is_empty() {
|
||||
// Do not create Lua context if there are no plugins
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
let lua = Lua::new();
|
||||
|
||||
for plugin_name in plugins {
|
||||
// TODO: properly load plugins from a central directory + user directories
|
||||
// TODO: how to handle plugin priority?
|
||||
let mut plugin_path = PathBuf::from("plugins");
|
||||
plugin_path.push(plugin_name);
|
||||
|
||||
let plugin_source_code = fs::read_to_string(&plugin_path).map_err(|e| {
|
||||
format!(
|
||||
"Could not load bat plugin '{}': {}",
|
||||
plugin_path.to_string_lossy(),
|
||||
e
|
||||
)
|
||||
})?;
|
||||
|
||||
lua.context::<_, LuaResult<()>>(|lua_ctx| {
|
||||
let globals = lua_ctx.globals();
|
||||
|
||||
lua_ctx.load(&plugin_source_code).exec()?;
|
||||
|
||||
// Plugins are expected to have a 'preprocess' function
|
||||
let preprocess: Function = globals.get("preprocess")?;
|
||||
|
||||
for input in inputs.iter_mut() {
|
||||
if let InputKind::OrdinaryFile(ref mut path) = &mut input.kind {
|
||||
let path_str: String = path.to_string_lossy().into();
|
||||
let new_path = preprocess.call::<_, String>(path_str)?;
|
||||
|
||||
*path = PathBuf::from(new_path);
|
||||
|
||||
// TODO: the following line overwrites actual user provided names. However,
|
||||
// this is necessary to get proper syntax highlighting for the path that
|
||||
// is being provided by the plugin.
|
||||
input.metadata.user_provided_name = Some(path.clone());
|
||||
}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
})
|
||||
.map_err(|e| format!("Error while executing Lua code: {}", e))?;
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn run_controller(mut inputs: Vec<Input>, config: &Config) -> Result<bool> {
|
||||
load_and_run_preprocess_plugins(&config.plugins, &mut inputs)?;
|
||||
|
||||
let assets = assets_from_cache_or_binary(config.use_custom_assets)?;
|
||||
let controller = Controller::new(config, &assets);
|
||||
controller.run(inputs)
|
||||
@@ -230,6 +290,9 @@ fn invoke_bugreport(app: &App) {
|
||||
let pager = bat::config::get_pager_executable(app.matches.value_of("pager"))
|
||||
.unwrap_or_else(|| "less".to_owned()); // FIXME: Avoid non-canonical path to "less".
|
||||
|
||||
let mut custom_assets_metadata = PROJECT_DIRS.cache_dir().to_path_buf();
|
||||
custom_assets_metadata.push("metadata.yaml");
|
||||
|
||||
let mut report = bugreport!()
|
||||
.info(SoftwareVersion::default())
|
||||
.info(OperatingSystem::default())
|
||||
@@ -254,6 +317,14 @@ fn invoke_bugreport(app: &App) {
|
||||
"MANPAGER",
|
||||
]))
|
||||
.info(FileContent::new("Config file", config_file()))
|
||||
.info(FileContent::new(
|
||||
"Custom assets metadata",
|
||||
custom_assets_metadata,
|
||||
))
|
||||
.info(DirectoryEntries::new(
|
||||
"Custom assets",
|
||||
PROJECT_DIRS.cache_dir(),
|
||||
))
|
||||
.info(CompileTimeInformation::default());
|
||||
|
||||
#[cfg(feature = "paging")]
|
||||
|
@@ -5,6 +5,8 @@ use crate::style::StyleComponents;
|
||||
use crate::syntax_mapping::SyntaxMapping;
|
||||
use crate::wrapping::WrappingMode;
|
||||
|
||||
use std::ffi::OsStr;
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub enum VisibleLines {
|
||||
/// Show all lines which are included in the line ranges
|
||||
@@ -86,6 +88,9 @@ pub struct Config<'a> {
|
||||
/// Whether or not to allow custom assets. If this is false or if custom assets (a.k.a.
|
||||
/// cached assets) are not available, assets from the binary will be used instead.
|
||||
pub use_custom_assets: bool,
|
||||
|
||||
/// List of bat plugins to be loaded
|
||||
pub plugins: Vec<&'a OsStr>,
|
||||
}
|
||||
|
||||
#[cfg(all(feature = "minimal-application", feature = "paging"))]
|
||||
|
@@ -2,11 +2,14 @@ use std::io::Write;
|
||||
use thiserror::Error;
|
||||
|
||||
#[derive(Error, Debug)]
|
||||
#[non_exhaustive]
|
||||
pub enum Error {
|
||||
#[error(transparent)]
|
||||
Io(#[from] ::std::io::Error),
|
||||
#[error(transparent)]
|
||||
SyntectError(#[from] ::syntect::LoadingError),
|
||||
SyntectError(#[from] ::syntect::Error),
|
||||
#[error(transparent)]
|
||||
SyntectLoadingError(#[from] ::syntect::LoadingError),
|
||||
#[error(transparent)]
|
||||
ParseIntError(#[from] ::std::num::ParseIntError),
|
||||
#[error(transparent)]
|
||||
|
23
src/input.rs
23
src/input.rs
@@ -1,4 +1,5 @@
|
||||
use std::convert::TryFrom;
|
||||
use std::fs;
|
||||
use std::fs::File;
|
||||
use std::io::{self, BufRead, BufReader, Read};
|
||||
use std::path::{Path, PathBuf};
|
||||
@@ -68,7 +69,8 @@ impl InputDescription {
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) enum InputKind<'a> {
|
||||
pub enum InputKind<'a> {
|
||||
// TODO
|
||||
OrdinaryFile(PathBuf),
|
||||
StdIn,
|
||||
CustomReader(Box<dyn Read + 'a>),
|
||||
@@ -85,13 +87,15 @@ impl<'a> InputKind<'a> {
|
||||
}
|
||||
|
||||
#[derive(Clone, Default)]
|
||||
pub(crate) struct InputMetadata {
|
||||
pub(crate) user_provided_name: Option<PathBuf>,
|
||||
pub struct InputMetadata {
|
||||
// TODO
|
||||
pub user_provided_name: Option<PathBuf>,
|
||||
pub(crate) size: Option<u64>,
|
||||
}
|
||||
|
||||
pub struct Input<'a> {
|
||||
pub(crate) kind: InputKind<'a>,
|
||||
pub(crate) metadata: InputMetadata,
|
||||
pub kind: InputKind<'a>, // TODO
|
||||
pub metadata: InputMetadata, // TODO
|
||||
pub(crate) description: InputDescription,
|
||||
}
|
||||
|
||||
@@ -116,7 +120,7 @@ impl OpenedInput<'_> {
|
||||
self.metadata
|
||||
.user_provided_name
|
||||
.as_ref()
|
||||
.or_else(|| match self.kind {
|
||||
.or(match self.kind {
|
||||
OpenedInputKind::OrdinaryFile(ref path) => Some(path),
|
||||
_ => None,
|
||||
})
|
||||
@@ -130,9 +134,14 @@ impl<'a> Input<'a> {
|
||||
|
||||
fn _ordinary_file(path: &Path) -> Self {
|
||||
let kind = InputKind::OrdinaryFile(path.to_path_buf());
|
||||
let metadata = InputMetadata {
|
||||
size: fs::metadata(path).map(|m| m.len()).ok(),
|
||||
..InputMetadata::default()
|
||||
};
|
||||
|
||||
Input {
|
||||
description: kind.description(),
|
||||
metadata: InputMetadata::default(),
|
||||
metadata,
|
||||
kind,
|
||||
}
|
||||
}
|
||||
|
65
src/less.rs
65
src/less.rs
@@ -3,21 +3,38 @@
|
||||
use std::ffi::OsStr;
|
||||
use std::process::Command;
|
||||
|
||||
pub fn retrieve_less_version(less_path: &dyn AsRef<OsStr>) -> Option<usize> {
|
||||
#[derive(Debug, PartialEq)]
|
||||
pub enum LessVersion {
|
||||
Less(usize),
|
||||
BusyBox,
|
||||
}
|
||||
|
||||
pub fn retrieve_less_version(less_path: &dyn AsRef<OsStr>) -> Option<LessVersion> {
|
||||
let resolved_path = grep_cli::resolve_binary(less_path.as_ref()).ok()?;
|
||||
|
||||
let cmd = Command::new(resolved_path).arg("--version").output().ok()?;
|
||||
if cmd.status.success() {
|
||||
parse_less_version(&cmd.stdout)
|
||||
} else {
|
||||
parse_less_version_busybox(&cmd.stderr)
|
||||
}
|
||||
}
|
||||
|
||||
fn parse_less_version(output: &[u8]) -> Option<usize> {
|
||||
fn parse_less_version(output: &[u8]) -> Option<LessVersion> {
|
||||
if !output.starts_with(b"less ") {
|
||||
return None;
|
||||
}
|
||||
|
||||
let version = std::str::from_utf8(&output[5..]).ok()?;
|
||||
let end = version.find(|c: char| !c.is_ascii_digit())?;
|
||||
version[..end].parse::<usize>().ok()
|
||||
Some(LessVersion::Less(version[..end].parse::<usize>().ok()?))
|
||||
}
|
||||
|
||||
fn parse_less_version_busybox(output: &[u8]) -> Option<LessVersion> {
|
||||
match std::str::from_utf8(output) {
|
||||
Ok(version) if version.contains("BusyBox ") => Some(LessVersion::BusyBox),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -30,7 +47,7 @@ For information about the terms of redistribution,
|
||||
see the file named README in the less distribution.
|
||||
Homepage: http://www.greenwoodsoftware.com/less";
|
||||
|
||||
assert_eq!(Some(487), parse_less_version(output));
|
||||
assert_eq!(Some(LessVersion::Less(487)), parse_less_version(output));
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -43,7 +60,7 @@ For information about the terms of redistribution,
|
||||
see the file named README in the less distribution.
|
||||
Homepage: http://www.greenwoodsoftware.com/less";
|
||||
|
||||
assert_eq!(Some(529), parse_less_version(output));
|
||||
assert_eq!(Some(LessVersion::Less(529)), parse_less_version(output));
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -56,7 +73,7 @@ For information about the terms of redistribution,
|
||||
see the file named README in the less distribution.
|
||||
Home page: http://www.greenwoodsoftware.com/less";
|
||||
|
||||
assert_eq!(Some(551), parse_less_version(output));
|
||||
assert_eq!(Some(LessVersion::Less(551)), parse_less_version(output));
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -69,7 +86,7 @@ For information about the terms of redistribution,
|
||||
see the file named README in the less distribution.
|
||||
Home page: https://greenwoodsoftware.com/less";
|
||||
|
||||
assert_eq!(Some(581), parse_less_version(output));
|
||||
assert_eq!(Some(LessVersion::Less(581)), parse_less_version(output));
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -77,4 +94,38 @@ fn test_parse_less_version_wrong_program() {
|
||||
let output = b"more from util-linux 2.34";
|
||||
|
||||
assert_eq!(None, parse_less_version(output));
|
||||
assert_eq!(None, parse_less_version_busybox(output));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_parse_less_version_busybox() {
|
||||
let output = b"pkg/less: unrecognized option '--version'
|
||||
BusyBox v1.35.0 (2022-04-21 10:38:11 EDT) multi-call binary.
|
||||
|
||||
Usage: less [-EFIMmNSRh~] [FILE]...
|
||||
|
||||
View FILE (or stdin) one screenful at a time
|
||||
|
||||
-E Quit once the end of a file is reached
|
||||
-F Quit if entire file fits on first screen
|
||||
-I Ignore case in all searches
|
||||
-M,-m Display status line with line numbers
|
||||
and percentage through the file
|
||||
-N Prefix line number to each line
|
||||
-S Truncate long lines
|
||||
-R Remove color escape codes in input
|
||||
-~ Suppress ~s displayed past EOF";
|
||||
|
||||
assert_eq!(
|
||||
Some(LessVersion::BusyBox),
|
||||
parse_less_version_busybox(output)
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_parse_less_version_invalid_utf_8() {
|
||||
let output = b"\xff";
|
||||
|
||||
assert_eq!(None, parse_less_version(output));
|
||||
assert_eq!(None, parse_less_version_busybox(output));
|
||||
}
|
||||
|
@@ -4,7 +4,7 @@ use std::process::Child;
|
||||
|
||||
use crate::error::*;
|
||||
#[cfg(feature = "paging")]
|
||||
use crate::less::retrieve_less_version;
|
||||
use crate::less::{retrieve_less_version, LessVersion};
|
||||
#[cfg(feature = "paging")]
|
||||
use crate::paging::PagingMode;
|
||||
#[cfg(feature = "paging")]
|
||||
@@ -83,13 +83,13 @@ impl OutputType {
|
||||
let replace_arguments_to_less = pager.source == PagerSource::EnvVarPager;
|
||||
|
||||
if args.is_empty() || replace_arguments_to_less {
|
||||
p.arg("--RAW-CONTROL-CHARS");
|
||||
p.arg("-R"); // Short version of --RAW-CONTROL-CHARS for maximum compatibility
|
||||
if single_screen_action == SingleScreenAction::Quit {
|
||||
p.arg("--quit-if-one-screen");
|
||||
p.arg("-F"); // Short version of --quit-if-one-screen for compatibility
|
||||
}
|
||||
|
||||
if wrapping_mode == WrappingMode::NoWrapping(true) {
|
||||
p.arg("--chop-long-lines");
|
||||
p.arg("-S"); // Short version of --chop-long-lines for compatibility
|
||||
}
|
||||
|
||||
// Passing '--no-init' fixes a bug with '--quit-if-one-screen' in older
|
||||
@@ -103,7 +103,9 @@ impl OutputType {
|
||||
None => {
|
||||
p.arg("--no-init");
|
||||
}
|
||||
Some(version) if (version < 530 || (cfg!(windows) && version < 558)) => {
|
||||
Some(LessVersion::Less(version))
|
||||
if (version < 530 || (cfg!(windows) && version < 558)) =>
|
||||
{
|
||||
p.arg("--no-init");
|
||||
}
|
||||
_ => {}
|
||||
|
@@ -53,26 +53,33 @@ pub fn replace_nonprintable(input: &[u8], tab_width: usize) -> String {
|
||||
let tab_width = if tab_width == 0 { 4 } else { tab_width };
|
||||
|
||||
let mut idx = 0;
|
||||
let mut line_idx = 0;
|
||||
let len = input.len();
|
||||
while idx < len {
|
||||
if let Some((chr, skip_ahead)) = try_parse_utf8_char(&input[idx..]) {
|
||||
idx += skip_ahead;
|
||||
line_idx += 1;
|
||||
|
||||
match chr {
|
||||
// space
|
||||
' ' => output.push('·'),
|
||||
// tab
|
||||
'\t' => {
|
||||
if tab_width == 1 {
|
||||
let tab_stop = tab_width - ((line_idx - 1) % tab_width);
|
||||
line_idx = 0;
|
||||
if tab_stop == 1 {
|
||||
output.push('↹');
|
||||
} else {
|
||||
output.push('├');
|
||||
output.push_str(&"─".repeat(tab_width - 2));
|
||||
output.push_str(&"─".repeat(tab_stop - 2));
|
||||
output.push('┤');
|
||||
}
|
||||
}
|
||||
// line feed
|
||||
'\x0A' => output.push_str("␊\x0A"),
|
||||
'\x0A' => {
|
||||
output.push_str("␊\x0A");
|
||||
line_idx = 0;
|
||||
}
|
||||
// carriage return
|
||||
'\x0D' => output.push('␍'),
|
||||
// null
|
||||
|
@@ -164,6 +164,12 @@ impl<'a> PrettyPrinter<'a> {
|
||||
self
|
||||
}
|
||||
|
||||
/// Whether to print binary content or nonprintable characters (default: no)
|
||||
pub fn show_nonprintable(&mut self, yes: bool) -> &mut Self {
|
||||
self.config.show_nonprintable = yes;
|
||||
self
|
||||
}
|
||||
|
||||
/// Whether to show "snip" markers between visible line ranges (default: no)
|
||||
pub fn snip(&mut self, yes: bool) -> &mut Self {
|
||||
self.active_style_components.snip = yes;
|
||||
|
115
src/printer.rs
115
src/printer.rs
@@ -4,6 +4,8 @@ use std::vec::Vec;
|
||||
use ansi_term::Colour::{Fixed, Green, Red, Yellow};
|
||||
use ansi_term::Style;
|
||||
|
||||
use bytesize::ByteSize;
|
||||
|
||||
use console::AnsiCodeIterator;
|
||||
|
||||
use syntect::easy::HighlightLines;
|
||||
@@ -29,6 +31,7 @@ use crate::error::*;
|
||||
use crate::input::OpenedInput;
|
||||
use crate::line_range::RangeCheckResult;
|
||||
use crate::preprocessor::{expand_tabs, replace_nonprintable};
|
||||
use crate::style::StyleComponent;
|
||||
use crate::terminal::{as_terminal_escaped, to_ansi_color};
|
||||
use crate::vscreen::AnsiStyle;
|
||||
use crate::wrapping::WrappingMode;
|
||||
@@ -250,6 +253,21 @@ impl<'a> InteractivePrinter<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
fn print_header_component_indent(&mut self, handle: &mut dyn Write) -> std::io::Result<()> {
|
||||
if self.config.style_components.grid() {
|
||||
write!(
|
||||
handle,
|
||||
"{}{}",
|
||||
" ".repeat(self.panel_width),
|
||||
self.colors
|
||||
.grid
|
||||
.paint(if self.panel_width > 0 { "│ " } else { "" }),
|
||||
)
|
||||
} else {
|
||||
write!(handle, "{}", " ".repeat(self.panel_width))
|
||||
}
|
||||
}
|
||||
|
||||
fn preprocess(&self, text: &str, cursor: &mut usize) -> String {
|
||||
if self.config.tab_width > 0 {
|
||||
return expand_tabs(text, self.config.tab_width, cursor);
|
||||
@@ -287,25 +305,6 @@ impl<'a> Printer for InteractivePrinter<'a> {
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
if self.config.style_components.grid() {
|
||||
self.print_horizontal_line(handle, '┬')?;
|
||||
|
||||
write!(
|
||||
handle,
|
||||
"{}{}",
|
||||
" ".repeat(self.panel_width),
|
||||
self.colors
|
||||
.grid
|
||||
.paint(if self.panel_width > 0 { "│ " } else { "" }),
|
||||
)?;
|
||||
} else {
|
||||
// Only pad space between files, if we haven't already drawn a horizontal rule
|
||||
if add_header_padding && !self.config.style_components.rule() {
|
||||
writeln!(handle)?;
|
||||
}
|
||||
write!(handle, "{}", " ".repeat(self.panel_width))?;
|
||||
}
|
||||
|
||||
let mode = match self.content_type {
|
||||
Some(ContentType::BINARY) => " <BINARY>",
|
||||
Some(ContentType::UTF_16LE) => " <UTF-16LE>",
|
||||
@@ -315,17 +314,60 @@ impl<'a> Printer for InteractivePrinter<'a> {
|
||||
};
|
||||
|
||||
let description = &input.description;
|
||||
let metadata = &input.metadata;
|
||||
|
||||
writeln!(
|
||||
// We use this iterator to have a deterministic order for
|
||||
// header components. HashSet has arbitrary order, but Vec is ordered.
|
||||
let header_components: Vec<StyleComponent> = [
|
||||
(
|
||||
StyleComponent::HeaderFilename,
|
||||
self.config.style_components.header_filename(),
|
||||
),
|
||||
(
|
||||
StyleComponent::HeaderFilesize,
|
||||
self.config.style_components.header_filesize(),
|
||||
),
|
||||
]
|
||||
.iter()
|
||||
.filter(|(_, is_enabled)| *is_enabled)
|
||||
.map(|(component, _)| *component)
|
||||
.collect();
|
||||
|
||||
// Print the cornering grid before the first header component
|
||||
if self.config.style_components.grid() {
|
||||
self.print_horizontal_line(handle, '┬')?;
|
||||
} else {
|
||||
// Only pad space between files, if we haven't already drawn a horizontal rule
|
||||
if add_header_padding && !self.config.style_components.rule() {
|
||||
writeln!(handle)?;
|
||||
}
|
||||
}
|
||||
|
||||
header_components.iter().try_for_each(|component| {
|
||||
self.print_header_component_indent(handle)?;
|
||||
|
||||
match component {
|
||||
StyleComponent::HeaderFilename => writeln!(
|
||||
handle,
|
||||
"{}{}{}",
|
||||
description
|
||||
.kind()
|
||||
.map(|kind| format!("{}: ", kind))
|
||||
.unwrap_or_else(|| "".into()),
|
||||
self.colors.filename.paint(description.title()),
|
||||
self.colors.header_value.paint(description.title()),
|
||||
mode
|
||||
)?;
|
||||
),
|
||||
|
||||
StyleComponent::HeaderFilesize => {
|
||||
let bsize = metadata
|
||||
.size
|
||||
.map(|s| format!("{}", ByteSize(s)))
|
||||
.unwrap_or_else(|| "-".into());
|
||||
writeln!(handle, "Size: {}", self.colors.header_value.paint(bsize))
|
||||
}
|
||||
_ => Ok(()),
|
||||
}
|
||||
})?;
|
||||
|
||||
if self.config.style_components.grid() {
|
||||
if self.content_type.map_or(false, |c| c.is_text()) || self.config.show_nonprintable {
|
||||
@@ -403,9 +445,21 @@ impl<'a> Printer for InteractivePrinter<'a> {
|
||||
return Ok(());
|
||||
}
|
||||
};
|
||||
highlighter_from_set
|
||||
|
||||
// skip syntax highlighting on long lines
|
||||
let too_long = line.len() > 1024 * 16;
|
||||
|
||||
let for_highlighting: &str = if too_long { "\n" } else { &line };
|
||||
|
||||
let mut highlighted_line = highlighter_from_set
|
||||
.highlighter
|
||||
.highlight(&line, highlighter_from_set.syntax_set)
|
||||
.highlight_line(for_highlighting, highlighter_from_set.syntax_set)?;
|
||||
|
||||
if too_long {
|
||||
highlighted_line[0].1 = &line;
|
||||
}
|
||||
|
||||
highlighted_line
|
||||
};
|
||||
|
||||
if out_of_range {
|
||||
@@ -421,6 +475,10 @@ impl<'a> Printer for InteractivePrinter<'a> {
|
||||
let highlight_this_line =
|
||||
self.config.highlighted_lines.0.check(line_number) == RangeCheckResult::InRange;
|
||||
|
||||
if highlight_this_line && self.config.theme == "ansi" {
|
||||
self.ansi_style.update("^[4m");
|
||||
}
|
||||
|
||||
let background_color = self
|
||||
.background_color_highlight
|
||||
.filter(|_| highlight_this_line);
|
||||
@@ -607,6 +665,11 @@ impl<'a> Printer for InteractivePrinter<'a> {
|
||||
writeln!(handle)?;
|
||||
}
|
||||
|
||||
if highlight_this_line && self.config.theme == "ansi" {
|
||||
self.ansi_style.update("^[24m");
|
||||
write!(handle, "\x1B[24m")?;
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
@@ -617,7 +680,7 @@ const DEFAULT_GUTTER_COLOR: u8 = 238;
|
||||
pub struct Colors {
|
||||
pub grid: Style,
|
||||
pub rule: Style,
|
||||
pub filename: Style,
|
||||
pub header_value: Style,
|
||||
pub git_added: Style,
|
||||
pub git_removed: Style,
|
||||
pub git_modified: Style,
|
||||
@@ -646,7 +709,7 @@ impl Colors {
|
||||
Colors {
|
||||
grid: gutter_style,
|
||||
rule: gutter_style,
|
||||
filename: Style::new().bold(),
|
||||
header_value: Style::new().bold(),
|
||||
git_added: Green.normal(),
|
||||
git_removed: Red.normal(),
|
||||
git_modified: Yellow.normal(),
|
||||
|
34
src/style.rs
34
src/style.rs
@@ -3,6 +3,7 @@ use std::str::FromStr;
|
||||
|
||||
use crate::error::*;
|
||||
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Eq, PartialEq, Copy, Clone, Hash)]
|
||||
pub enum StyleComponent {
|
||||
Auto,
|
||||
@@ -11,9 +12,12 @@ pub enum StyleComponent {
|
||||
Grid,
|
||||
Rule,
|
||||
Header,
|
||||
HeaderFilename,
|
||||
HeaderFilesize,
|
||||
LineNumbers,
|
||||
Snip,
|
||||
Full,
|
||||
Default,
|
||||
Plain,
|
||||
}
|
||||
|
||||
@@ -22,7 +26,7 @@ impl StyleComponent {
|
||||
match self {
|
||||
StyleComponent::Auto => {
|
||||
if interactive_terminal {
|
||||
StyleComponent::Full.components(interactive_terminal)
|
||||
StyleComponent::Default.components(interactive_terminal)
|
||||
} else {
|
||||
StyleComponent::Plain.components(interactive_terminal)
|
||||
}
|
||||
@@ -31,14 +35,25 @@ impl StyleComponent {
|
||||
StyleComponent::Changes => &[StyleComponent::Changes],
|
||||
StyleComponent::Grid => &[StyleComponent::Grid],
|
||||
StyleComponent::Rule => &[StyleComponent::Rule],
|
||||
StyleComponent::Header => &[StyleComponent::Header],
|
||||
StyleComponent::Header => &[StyleComponent::HeaderFilename],
|
||||
StyleComponent::HeaderFilename => &[StyleComponent::HeaderFilename],
|
||||
StyleComponent::HeaderFilesize => &[StyleComponent::HeaderFilesize],
|
||||
StyleComponent::LineNumbers => &[StyleComponent::LineNumbers],
|
||||
StyleComponent::Snip => &[StyleComponent::Snip],
|
||||
StyleComponent::Full => &[
|
||||
#[cfg(feature = "git")]
|
||||
StyleComponent::Changes,
|
||||
StyleComponent::Grid,
|
||||
StyleComponent::Header,
|
||||
StyleComponent::HeaderFilename,
|
||||
StyleComponent::HeaderFilesize,
|
||||
StyleComponent::LineNumbers,
|
||||
StyleComponent::Snip,
|
||||
],
|
||||
StyleComponent::Default => &[
|
||||
#[cfg(feature = "git")]
|
||||
StyleComponent::Changes,
|
||||
StyleComponent::Grid,
|
||||
StyleComponent::HeaderFilename,
|
||||
StyleComponent::LineNumbers,
|
||||
StyleComponent::Snip,
|
||||
],
|
||||
@@ -58,9 +73,12 @@ impl FromStr for StyleComponent {
|
||||
"grid" => Ok(StyleComponent::Grid),
|
||||
"rule" => Ok(StyleComponent::Rule),
|
||||
"header" => Ok(StyleComponent::Header),
|
||||
"header-filename" => Ok(StyleComponent::HeaderFilename),
|
||||
"header-filesize" => Ok(StyleComponent::HeaderFilesize),
|
||||
"numbers" => Ok(StyleComponent::LineNumbers),
|
||||
"snip" => Ok(StyleComponent::Snip),
|
||||
"full" => Ok(StyleComponent::Full),
|
||||
"default" => Ok(StyleComponent::Default),
|
||||
"plain" => Ok(StyleComponent::Plain),
|
||||
_ => Err(format!("Unknown style '{}'", s).into()),
|
||||
}
|
||||
@@ -89,7 +107,15 @@ impl StyleComponents {
|
||||
}
|
||||
|
||||
pub fn header(&self) -> bool {
|
||||
self.0.contains(&StyleComponent::Header)
|
||||
self.header_filename() || self.header_filesize()
|
||||
}
|
||||
|
||||
pub fn header_filename(&self) -> bool {
|
||||
self.0.contains(&StyleComponent::HeaderFilename)
|
||||
}
|
||||
|
||||
pub fn header_filesize(&self) -> bool {
|
||||
self.0.contains(&StyleComponent::HeaderFilesize)
|
||||
}
|
||||
|
||||
pub fn numbers(&self) -> bool {
|
||||
|
@@ -41,6 +41,9 @@ impl<'a> SyntaxMapping<'a> {
|
||||
pub fn builtin() -> SyntaxMapping<'a> {
|
||||
let mut mapping = Self::empty();
|
||||
mapping.insert("*.h", MappingTarget::MapTo("C++")).unwrap();
|
||||
mapping
|
||||
.insert(".clang-format", MappingTarget::MapTo("YAML"))
|
||||
.unwrap();
|
||||
mapping.insert("*.fs", MappingTarget::MapTo("F#")).unwrap();
|
||||
mapping
|
||||
.insert("build", MappingTarget::MapToUnknown)
|
||||
@@ -117,13 +120,32 @@ impl<'a> SyntaxMapping<'a> {
|
||||
mapping.insert(glob, MappingTarget::MapTo("INI")).unwrap();
|
||||
}
|
||||
|
||||
// unix mail spool
|
||||
for glob in &["/var/spool/mail/*", "/var/mail/*"] {
|
||||
mapping.insert(glob, MappingTarget::MapTo("Email")).unwrap()
|
||||
}
|
||||
|
||||
// pacman hooks
|
||||
mapping
|
||||
.insert("*.hook", MappingTarget::MapTo("INI"))
|
||||
.unwrap();
|
||||
|
||||
if let Some(xdg_config_home) = std::env::var_os("XDG_CONFIG_HOME") {
|
||||
let git_config_path = Path::new(&xdg_config_home).join("git");
|
||||
// Global git config files rooted in `$XDG_CONFIG_HOME/git/` or `$HOME/.config/git/`
|
||||
// See e.g. https://git-scm.com/docs/git-config#FILES
|
||||
if let Some(xdg_config_home) =
|
||||
std::env::var_os("XDG_CONFIG_HOME").filter(|val| !val.is_empty())
|
||||
{
|
||||
insert_git_config_global(&mut mapping, &xdg_config_home);
|
||||
}
|
||||
if let Some(default_config_home) = std::env::var_os("HOME")
|
||||
.filter(|val| !val.is_empty())
|
||||
.map(|home| Path::new(&home).join(".config"))
|
||||
{
|
||||
insert_git_config_global(&mut mapping, &default_config_home);
|
||||
}
|
||||
|
||||
fn insert_git_config_global(mapping: &mut SyntaxMapping, config_home: impl AsRef<Path>) {
|
||||
let git_config_path = config_home.as_ref().join("git");
|
||||
|
||||
mapping
|
||||
.insert(
|
||||
|
1
tests/benchmarks/many-small-files/small-file-0.txt
vendored
Normal file
1
tests/benchmarks/many-small-files/small-file-0.txt
vendored
Normal file
@@ -0,0 +1 @@
|
||||
I am small file 0
|
1
tests/benchmarks/many-small-files/small-file-1.txt
vendored
Normal file
1
tests/benchmarks/many-small-files/small-file-1.txt
vendored
Normal file
@@ -0,0 +1 @@
|
||||
I am small file 1
|
1
tests/benchmarks/many-small-files/small-file-10.txt
vendored
Normal file
1
tests/benchmarks/many-small-files/small-file-10.txt
vendored
Normal file
@@ -0,0 +1 @@
|
||||
I am small file 10
|
1
tests/benchmarks/many-small-files/small-file-100.txt
vendored
Normal file
1
tests/benchmarks/many-small-files/small-file-100.txt
vendored
Normal file
@@ -0,0 +1 @@
|
||||
I am small file 100
|
1
tests/benchmarks/many-small-files/small-file-11.txt
vendored
Normal file
1
tests/benchmarks/many-small-files/small-file-11.txt
vendored
Normal file
@@ -0,0 +1 @@
|
||||
I am small file 11
|
1
tests/benchmarks/many-small-files/small-file-12.txt
vendored
Normal file
1
tests/benchmarks/many-small-files/small-file-12.txt
vendored
Normal file
@@ -0,0 +1 @@
|
||||
I am small file 12
|
1
tests/benchmarks/many-small-files/small-file-13.txt
vendored
Normal file
1
tests/benchmarks/many-small-files/small-file-13.txt
vendored
Normal file
@@ -0,0 +1 @@
|
||||
I am small file 13
|
1
tests/benchmarks/many-small-files/small-file-14.txt
vendored
Normal file
1
tests/benchmarks/many-small-files/small-file-14.txt
vendored
Normal file
@@ -0,0 +1 @@
|
||||
I am small file 14
|
1
tests/benchmarks/many-small-files/small-file-15.txt
vendored
Normal file
1
tests/benchmarks/many-small-files/small-file-15.txt
vendored
Normal file
@@ -0,0 +1 @@
|
||||
I am small file 15
|
1
tests/benchmarks/many-small-files/small-file-16.txt
vendored
Normal file
1
tests/benchmarks/many-small-files/small-file-16.txt
vendored
Normal file
@@ -0,0 +1 @@
|
||||
I am small file 16
|
1
tests/benchmarks/many-small-files/small-file-17.txt
vendored
Normal file
1
tests/benchmarks/many-small-files/small-file-17.txt
vendored
Normal file
@@ -0,0 +1 @@
|
||||
I am small file 17
|
1
tests/benchmarks/many-small-files/small-file-18.txt
vendored
Normal file
1
tests/benchmarks/many-small-files/small-file-18.txt
vendored
Normal file
@@ -0,0 +1 @@
|
||||
I am small file 18
|
1
tests/benchmarks/many-small-files/small-file-19.txt
vendored
Normal file
1
tests/benchmarks/many-small-files/small-file-19.txt
vendored
Normal file
@@ -0,0 +1 @@
|
||||
I am small file 19
|
1
tests/benchmarks/many-small-files/small-file-2.txt
vendored
Normal file
1
tests/benchmarks/many-small-files/small-file-2.txt
vendored
Normal file
@@ -0,0 +1 @@
|
||||
I am small file 2
|
1
tests/benchmarks/many-small-files/small-file-20.txt
vendored
Normal file
1
tests/benchmarks/many-small-files/small-file-20.txt
vendored
Normal file
@@ -0,0 +1 @@
|
||||
I am small file 20
|
1
tests/benchmarks/many-small-files/small-file-21.txt
vendored
Normal file
1
tests/benchmarks/many-small-files/small-file-21.txt
vendored
Normal file
@@ -0,0 +1 @@
|
||||
I am small file 21
|
1
tests/benchmarks/many-small-files/small-file-22.txt
vendored
Normal file
1
tests/benchmarks/many-small-files/small-file-22.txt
vendored
Normal file
@@ -0,0 +1 @@
|
||||
I am small file 22
|
1
tests/benchmarks/many-small-files/small-file-23.txt
vendored
Normal file
1
tests/benchmarks/many-small-files/small-file-23.txt
vendored
Normal file
@@ -0,0 +1 @@
|
||||
I am small file 23
|
1
tests/benchmarks/many-small-files/small-file-24.txt
vendored
Normal file
1
tests/benchmarks/many-small-files/small-file-24.txt
vendored
Normal file
@@ -0,0 +1 @@
|
||||
I am small file 24
|
1
tests/benchmarks/many-small-files/small-file-25.txt
vendored
Normal file
1
tests/benchmarks/many-small-files/small-file-25.txt
vendored
Normal file
@@ -0,0 +1 @@
|
||||
I am small file 25
|
1
tests/benchmarks/many-small-files/small-file-26.txt
vendored
Normal file
1
tests/benchmarks/many-small-files/small-file-26.txt
vendored
Normal file
@@ -0,0 +1 @@
|
||||
I am small file 26
|
1
tests/benchmarks/many-small-files/small-file-27.txt
vendored
Normal file
1
tests/benchmarks/many-small-files/small-file-27.txt
vendored
Normal file
@@ -0,0 +1 @@
|
||||
I am small file 27
|
1
tests/benchmarks/many-small-files/small-file-28.txt
vendored
Normal file
1
tests/benchmarks/many-small-files/small-file-28.txt
vendored
Normal file
@@ -0,0 +1 @@
|
||||
I am small file 28
|
1
tests/benchmarks/many-small-files/small-file-29.txt
vendored
Normal file
1
tests/benchmarks/many-small-files/small-file-29.txt
vendored
Normal file
@@ -0,0 +1 @@
|
||||
I am small file 29
|
1
tests/benchmarks/many-small-files/small-file-3.txt
vendored
Normal file
1
tests/benchmarks/many-small-files/small-file-3.txt
vendored
Normal file
@@ -0,0 +1 @@
|
||||
I am small file 3
|
1
tests/benchmarks/many-small-files/small-file-30.txt
vendored
Normal file
1
tests/benchmarks/many-small-files/small-file-30.txt
vendored
Normal file
@@ -0,0 +1 @@
|
||||
I am small file 30
|
1
tests/benchmarks/many-small-files/small-file-31.txt
vendored
Normal file
1
tests/benchmarks/many-small-files/small-file-31.txt
vendored
Normal file
@@ -0,0 +1 @@
|
||||
I am small file 31
|
1
tests/benchmarks/many-small-files/small-file-32.txt
vendored
Normal file
1
tests/benchmarks/many-small-files/small-file-32.txt
vendored
Normal file
@@ -0,0 +1 @@
|
||||
I am small file 32
|
1
tests/benchmarks/many-small-files/small-file-33.txt
vendored
Normal file
1
tests/benchmarks/many-small-files/small-file-33.txt
vendored
Normal file
@@ -0,0 +1 @@
|
||||
I am small file 33
|
1
tests/benchmarks/many-small-files/small-file-34.txt
vendored
Normal file
1
tests/benchmarks/many-small-files/small-file-34.txt
vendored
Normal file
@@ -0,0 +1 @@
|
||||
I am small file 34
|
1
tests/benchmarks/many-small-files/small-file-35.txt
vendored
Normal file
1
tests/benchmarks/many-small-files/small-file-35.txt
vendored
Normal file
@@ -0,0 +1 @@
|
||||
I am small file 35
|
1
tests/benchmarks/many-small-files/small-file-36.txt
vendored
Normal file
1
tests/benchmarks/many-small-files/small-file-36.txt
vendored
Normal file
@@ -0,0 +1 @@
|
||||
I am small file 36
|
1
tests/benchmarks/many-small-files/small-file-37.txt
vendored
Normal file
1
tests/benchmarks/many-small-files/small-file-37.txt
vendored
Normal file
@@ -0,0 +1 @@
|
||||
I am small file 37
|
1
tests/benchmarks/many-small-files/small-file-38.txt
vendored
Normal file
1
tests/benchmarks/many-small-files/small-file-38.txt
vendored
Normal file
@@ -0,0 +1 @@
|
||||
I am small file 38
|
1
tests/benchmarks/many-small-files/small-file-39.txt
vendored
Normal file
1
tests/benchmarks/many-small-files/small-file-39.txt
vendored
Normal file
@@ -0,0 +1 @@
|
||||
I am small file 39
|
1
tests/benchmarks/many-small-files/small-file-4.txt
vendored
Normal file
1
tests/benchmarks/many-small-files/small-file-4.txt
vendored
Normal file
@@ -0,0 +1 @@
|
||||
I am small file 4
|
1
tests/benchmarks/many-small-files/small-file-40.txt
vendored
Normal file
1
tests/benchmarks/many-small-files/small-file-40.txt
vendored
Normal file
@@ -0,0 +1 @@
|
||||
I am small file 40
|
1
tests/benchmarks/many-small-files/small-file-41.txt
vendored
Normal file
1
tests/benchmarks/many-small-files/small-file-41.txt
vendored
Normal file
@@ -0,0 +1 @@
|
||||
I am small file 41
|
1
tests/benchmarks/many-small-files/small-file-42.txt
vendored
Normal file
1
tests/benchmarks/many-small-files/small-file-42.txt
vendored
Normal file
@@ -0,0 +1 @@
|
||||
I am small file 42
|
1
tests/benchmarks/many-small-files/small-file-43.txt
vendored
Normal file
1
tests/benchmarks/many-small-files/small-file-43.txt
vendored
Normal file
@@ -0,0 +1 @@
|
||||
I am small file 43
|
1
tests/benchmarks/many-small-files/small-file-44.txt
vendored
Normal file
1
tests/benchmarks/many-small-files/small-file-44.txt
vendored
Normal file
@@ -0,0 +1 @@
|
||||
I am small file 44
|
1
tests/benchmarks/many-small-files/small-file-45.txt
vendored
Normal file
1
tests/benchmarks/many-small-files/small-file-45.txt
vendored
Normal file
@@ -0,0 +1 @@
|
||||
I am small file 45
|
1
tests/benchmarks/many-small-files/small-file-46.txt
vendored
Normal file
1
tests/benchmarks/many-small-files/small-file-46.txt
vendored
Normal file
@@ -0,0 +1 @@
|
||||
I am small file 46
|
1
tests/benchmarks/many-small-files/small-file-47.txt
vendored
Normal file
1
tests/benchmarks/many-small-files/small-file-47.txt
vendored
Normal file
@@ -0,0 +1 @@
|
||||
I am small file 47
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user