mirror of
https://github.com/sharkdp/bat
synced 2026-08-04 19:01:44 +00:00
Compare commits
86 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e09499b3df | |||
| cff01d81fa | |||
| 31608c9a03 | |||
| 357ce84c56 | |||
| 3a5c52641b | |||
| 6e8fca5bb2 | |||
| 63c77383ce | |||
| 4df22e617f | |||
| 6473e8c1be | |||
| 972a764a74 | |||
| 54143d1403 | |||
| 6523bbf62f | |||
| 05e2c2c66b | |||
| 69227222b5 | |||
| 49af3e854b | |||
| 6a8e4757b7 | |||
| 91deef8b13 | |||
| 61e888de7f | |||
| f3f9f10f05 | |||
| 29ffa2a832 | |||
| 42a873fdb8 | |||
| 82f048aedb | |||
| ae08785ec8 | |||
| a500629359 | |||
| 724a5fac99 | |||
| c483e49b92 | |||
| 94c9b40694 | |||
| 0c9dc3b257 | |||
| 3b5174bb1d | |||
| 3324505383 | |||
| de7872f8a8 | |||
| abf0229741 | |||
| e04bccd12d | |||
| 668c8a6703 | |||
| bd68684537 | |||
| c2847f6a9f | |||
| cf7ed042c1 | |||
| 6b92814ea0 | |||
| a236a9b195 | |||
| b68c5d8576 | |||
| fee57d71d9 | |||
| 5d3205acc0 | |||
| 4e6816abd6 | |||
| 72e8036edc | |||
| 397def1320 | |||
| d2d29180a7 | |||
| 2f263c9fbf | |||
| 4ff360669f | |||
| 549e5d7355 | |||
| dd48d29c28 | |||
| 98ee5f7400 | |||
| 638c04c13e | |||
| b1c865acaa | |||
| d3d795ffb2 | |||
| 0571c51487 | |||
| 348c9f3562 | |||
| 6b6a8f8e16 | |||
| 6aa002850c | |||
| 49c22c8d39 | |||
| 673caf6b59 | |||
| e6ffab3cb4 | |||
| 4e43f8fa74 | |||
| bac1b16885 | |||
| 778a4929a8 | |||
| 5c22dd4248 | |||
| 214cd0f8ea | |||
| 9fd61fcb6d | |||
| edf1d3b256 | |||
| eca47b2a28 | |||
| 62424e70d7 | |||
| 4791f15222 | |||
| 159f234b78 | |||
| 3ec96127f2 | |||
| a9acb2711b | |||
| a3182e68e4 | |||
| 0691b18231 | |||
| c711cd1b2e | |||
| 14e6b41a5f | |||
| 532af6556d | |||
| 26717b0cd2 | |||
| 1f177f0a1c | |||
| 54c81fa543 | |||
| 34dee9e3aa | |||
| cea05e9f22 | |||
| 2a7851530d | |||
| 1a6709c2cb |
+26
@@ -97,3 +97,29 @@
|
|||||||
[submodule "assets/themes/sublime-snazzy"]
|
[submodule "assets/themes/sublime-snazzy"]
|
||||||
path = assets/themes/sublime-snazzy
|
path = assets/themes/sublime-snazzy
|
||||||
url = https://github.com/greggb/sublime-snazzy
|
url = https://github.com/greggb/sublime-snazzy
|
||||||
|
[submodule "assets/syntaxes/HTML (Twig)"]
|
||||||
|
path = assets/syntaxes/HTML (Twig)
|
||||||
|
url = https://github.com/Anomareh/PHP-Twig.tmbundle.git
|
||||||
|
[submodule "assets/syntaxes/AsciiDoc"]
|
||||||
|
path = assets/syntaxes/AsciiDoc
|
||||||
|
url = https://github.com/SublimeText/AsciiDoc.git
|
||||||
|
[submodule "assets/syntaxes/Assembly (ARM)"]
|
||||||
|
path = assets/syntaxes/Assembly (ARM)
|
||||||
|
url = https://github.com/tvi/Sublime-ARM-Assembly
|
||||||
|
[submodule "assets/syntaxes/syslog-syntax"]
|
||||||
|
path = assets/syntaxes/Syslog
|
||||||
|
url = https://github.com/caos21/syslog-syntax.git
|
||||||
|
branch = master
|
||||||
|
[submodule "assets/syntaxes/protobuf-syntax-highlighting"]
|
||||||
|
path = assets/syntaxes/Protobuf
|
||||||
|
url = https://github.com/VcamX/protobuf-syntax-highlighting.git
|
||||||
|
branch = master
|
||||||
|
[submodule "assets/syntaxes/Terraform"]
|
||||||
|
path = assets/syntaxes/Terraform
|
||||||
|
url = https://github.com/alexlouden/Terraform.tmLanguage.git
|
||||||
|
[submodule "assets/syntaxes/Jsonnet"]
|
||||||
|
path = assets/syntaxes/Jsonnet
|
||||||
|
url = https://github.com/gburiola/sublime-jsonnet-syntax.git
|
||||||
|
[submodule "assets/syntaxes/varlink"]
|
||||||
|
path = assets/syntaxes/varlink
|
||||||
|
url = https://github.com/varlink/syntax-highlight-varlink.git
|
||||||
|
|||||||
+3
-3
@@ -32,15 +32,15 @@ matrix:
|
|||||||
|
|
||||||
# Minimum Rust supported channel.
|
# Minimum Rust supported channel.
|
||||||
- os: linux
|
- os: linux
|
||||||
rust: 1.29.0
|
rust: 1.30.0
|
||||||
env: TARGET=x86_64-unknown-linux-gnu
|
env: TARGET=x86_64-unknown-linux-gnu
|
||||||
- os: linux
|
- os: linux
|
||||||
rust: 1.29.0
|
rust: 1.30.0
|
||||||
env:
|
env:
|
||||||
- TARGET=x86_64-unknown-linux-musl
|
- TARGET=x86_64-unknown-linux-musl
|
||||||
- CC_x86_64_unknown_linux_musl=/usr/bin/musl-gcc
|
- CC_x86_64_unknown_linux_musl=/usr/bin/musl-gcc
|
||||||
- os: osx
|
- os: osx
|
||||||
rust: 1.29.0
|
rust: 1.30.0
|
||||||
env: TARGET=x86_64-apple-darwin
|
env: TARGET=x86_64-apple-darwin
|
||||||
|
|
||||||
# Code formatting check
|
# Code formatting check
|
||||||
|
|||||||
Generated
+159
-33
@@ -28,11 +28,28 @@ dependencies = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "assert_cmd"
|
name = "argon2rs"
|
||||||
version = "0.10.1"
|
version = "0.2.5"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"escargot 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"blake2-rfc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"scoped_threadpool 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "arrayvec"
|
||||||
|
version = "0.4.10"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
dependencies = [
|
||||||
|
"nodrop 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "assert_cmd"
|
||||||
|
version = "0.11.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
dependencies = [
|
||||||
|
"escargot 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"predicates 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"predicates 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"predicates-core 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"predicates-core 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"predicates-tree 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"predicates-tree 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
@@ -48,6 +65,27 @@ dependencies = [
|
|||||||
"winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
"winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "backtrace"
|
||||||
|
version = "0.3.11"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
dependencies = [
|
||||||
|
"backtrace-sys 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"rustc-demangle 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "backtrace-sys"
|
||||||
|
version = "0.1.28"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
dependencies = [
|
||||||
|
"cc 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "base64"
|
name = "base64"
|
||||||
version = "0.9.3"
|
version = "0.9.3"
|
||||||
@@ -59,20 +97,20 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bat"
|
name = "bat"
|
||||||
version = "0.9.0"
|
version = "0.10.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"ansi_colours 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"ansi_colours 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"assert_cmd 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"assert_cmd 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
"atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"console 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"console 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"content_inspector 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
"content_inspector 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"directories 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"dirs 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"encoding 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
|
"encoding 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"escargot 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"escargot 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"git2 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
"git2 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"shell-words 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"shell-words 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"syntect 3.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"syntect 3.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
@@ -94,6 +132,15 @@ name = "bitflags"
|
|||||||
version = "1.0.4"
|
version = "1.0.4"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "blake2-rfc"
|
||||||
|
version = "0.2.18"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
dependencies = [
|
||||||
|
"arrayvec 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"constant_time_eq 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "build_const"
|
name = "build_const"
|
||||||
version = "0.2.1"
|
version = "0.2.1"
|
||||||
@@ -131,11 +178,11 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "clicolors-control"
|
name = "clicolors-control"
|
||||||
version = "0.2.0"
|
version = "1.0.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
"lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
|
"libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
"winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
@@ -150,11 +197,12 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "console"
|
name = "console"
|
||||||
version = "0.6.2"
|
version = "0.7.5"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
"atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"clicolors-control 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"clicolors-control 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"encode_unicode 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
|
"libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
"parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
@@ -164,6 +212,11 @@ dependencies = [
|
|||||||
"winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
"winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "constant_time_eq"
|
||||||
|
version = "0.1.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "content_inspector"
|
name = "content_inspector"
|
||||||
version = "0.2.4"
|
version = "0.2.4"
|
||||||
@@ -186,14 +239,20 @@ version = "2.0.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "directories"
|
name = "dirs"
|
||||||
version = "1.0.2"
|
version = "1.0.4"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
|
"libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"redox_users 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
"winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "encode_unicode"
|
||||||
|
version = "0.3.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "encoding"
|
name = "encoding"
|
||||||
version = "0.2.33"
|
version = "0.2.33"
|
||||||
@@ -258,13 +317,35 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "escargot"
|
name = "escargot"
|
||||||
version = "0.3.1"
|
version = "0.4.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
"lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)",
|
"serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"serde_json 1.0.33 (registry+https://github.com/rust-lang/crates.io-index)",
|
"serde_json 1.0.33 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "failure"
|
||||||
|
version = "0.1.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
dependencies = [
|
||||||
|
"backtrace 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"failure_derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "failure_derive"
|
||||||
|
version = "0.1.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro2 0.4.21 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"syn 0.15.19 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"synstructure 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "flate2"
|
name = "flate2"
|
||||||
version = "1.0.4"
|
version = "1.0.4"
|
||||||
@@ -296,12 +377,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "git2"
|
name = "git2"
|
||||||
version = "0.7.5"
|
version = "0.8.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
"bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
|
"libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"libgit2-sys 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
"libgit2-sys 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
@@ -343,11 +424,6 @@ dependencies = [
|
|||||||
"winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "lazy_static"
|
|
||||||
version = "0.2.11"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "lazy_static"
|
name = "lazy_static"
|
||||||
version = "1.2.0"
|
version = "1.2.0"
|
||||||
@@ -365,7 +441,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libgit2-sys"
|
name = "libgit2-sys"
|
||||||
version = "0.7.10"
|
version = "0.7.11"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cc 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)",
|
"cc 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
@@ -450,6 +526,11 @@ dependencies = [
|
|||||||
"miniz_oxide 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"miniz_oxide 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "nodrop"
|
||||||
|
version = "0.1.13"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "onig"
|
name = "onig"
|
||||||
version = "4.2.1"
|
version = "4.2.1"
|
||||||
@@ -614,6 +695,17 @@ dependencies = [
|
|||||||
"redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)",
|
"redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "redox_users"
|
||||||
|
version = "0.2.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
dependencies = [
|
||||||
|
"argon2rs 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "regex"
|
name = "regex"
|
||||||
version = "1.0.6"
|
version = "1.0.6"
|
||||||
@@ -642,6 +734,11 @@ dependencies = [
|
|||||||
"winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
"winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "rustc-demangle"
|
||||||
|
version = "0.1.13"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rustc_version"
|
name = "rustc_version"
|
||||||
version = "0.2.3"
|
version = "0.2.3"
|
||||||
@@ -668,6 +765,11 @@ dependencies = [
|
|||||||
"winapi-util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"winapi-util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "scoped_threadpool"
|
||||||
|
version = "0.1.9"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "scopeguard"
|
name = "scopeguard"
|
||||||
version = "0.3.3"
|
version = "0.3.3"
|
||||||
@@ -747,6 +849,17 @@ dependencies = [
|
|||||||
"unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "synstructure"
|
||||||
|
version = "0.10.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro2 0.4.21 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"syn 0.15.19 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "syntect"
|
name = "syntect"
|
||||||
version = "3.0.2"
|
version = "3.0.2"
|
||||||
@@ -974,23 +1087,30 @@ dependencies = [
|
|||||||
"checksum aho-corasick 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)" = "1e9a933f4e58658d7b12defcf96dc5c720f20832deebe3e0a19efd3b6aaeeb9e"
|
"checksum aho-corasick 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)" = "1e9a933f4e58658d7b12defcf96dc5c720f20832deebe3e0a19efd3b6aaeeb9e"
|
||||||
"checksum ansi_colours 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1d0f302a81afc6a7f4350c04f0ba7cfab529cc009bca3324b3fb5764e6add8b6"
|
"checksum ansi_colours 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1d0f302a81afc6a7f4350c04f0ba7cfab529cc009bca3324b3fb5764e6add8b6"
|
||||||
"checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b"
|
"checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b"
|
||||||
"checksum assert_cmd 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d5db841dcfb4f172f34ec968f71c4a88e69f5421fb33e0daac6bfe4372317526"
|
"checksum argon2rs 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "3f67b0b6a86dae6e67ff4ca2b6201396074996379fba2b92ff649126f37cb392"
|
||||||
|
"checksum arrayvec 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)" = "92c7fb76bc8826a8b33b4ee5bb07a247a81e76764ab4d55e8f73e3a4d8808c71"
|
||||||
|
"checksum assert_cmd 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7eaef71d143e8053e28166ea984712b71a5e5d7f26a885809eb829e0c8e4f051"
|
||||||
"checksum atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "9a7d5b8723950951411ee34d271d99dddcc2035a16ab25310ea2c8cfd4369652"
|
"checksum atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "9a7d5b8723950951411ee34d271d99dddcc2035a16ab25310ea2c8cfd4369652"
|
||||||
|
"checksum backtrace 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)" = "18b65ea1161bfb2dd6da6fade5edd4dbd08fba85012123dd333d2fd1b90b2782"
|
||||||
|
"checksum backtrace-sys 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)" = "797c830ac25ccc92a7f8a7b9862bde440715531514594a6154e3d4a54dd769b6"
|
||||||
"checksum base64 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)" = "489d6c0ed21b11d038c31b6ceccca973e65d73ba3bd8ecb9a2babf5546164643"
|
"checksum base64 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)" = "489d6c0ed21b11d038c31b6ceccca973e65d73ba3bd8ecb9a2babf5546164643"
|
||||||
"checksum bincode 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9f2fb9e29e72fd6bc12071533d5dc7664cb01480c59406f656d7ac25c7bd8ff7"
|
"checksum bincode 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9f2fb9e29e72fd6bc12071533d5dc7664cb01480c59406f656d7ac25c7bd8ff7"
|
||||||
"checksum bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "228047a76f468627ca71776ecdebd732a3423081fcf5125585bcd7c49886ce12"
|
"checksum bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "228047a76f468627ca71776ecdebd732a3423081fcf5125585bcd7c49886ce12"
|
||||||
|
"checksum blake2-rfc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)" = "5d6d530bdd2d52966a6d03b7a964add7ae1a288d25214066fd4b600f0f796400"
|
||||||
"checksum build_const 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "39092a32794787acd8525ee150305ff051b0aa6cc2abaf193924f5ab05425f39"
|
"checksum build_const 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "39092a32794787acd8525ee150305ff051b0aa6cc2abaf193924f5ab05425f39"
|
||||||
"checksum byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "94f88df23a25417badc922ab0f5716cc1330e87f71ddd9203b3a3ccd9cedf75d"
|
"checksum byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "94f88df23a25417badc922ab0f5716cc1330e87f71ddd9203b3a3ccd9cedf75d"
|
||||||
"checksum cc 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)" = "f159dfd43363c4d08055a07703eb7a3406b0dac4d0584d96965a3262db3c9d16"
|
"checksum cc 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)" = "f159dfd43363c4d08055a07703eb7a3406b0dac4d0584d96965a3262db3c9d16"
|
||||||
"checksum cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "082bb9b28e00d3c9d39cc03e64ce4cea0f1bb9b3fde493f0cbc008472d22bdf4"
|
"checksum cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "082bb9b28e00d3c9d39cc03e64ce4cea0f1bb9b3fde493f0cbc008472d22bdf4"
|
||||||
"checksum clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b957d88f4b6a63b9d70d5f454ac8011819c6efa7727858f458ab71c756ce2d3e"
|
"checksum clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b957d88f4b6a63b9d70d5f454ac8011819c6efa7727858f458ab71c756ce2d3e"
|
||||||
"checksum clicolors-control 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1f84dec9bc083ce2503908cd305af98bd363da6f54bf8d4bf0ac14ee749ad5d1"
|
"checksum clicolors-control 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "73abfd4c73d003a674ce5d2933fca6ce6c42480ea84a5ffe0a2dc39ed56300f9"
|
||||||
"checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f"
|
"checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f"
|
||||||
"checksum console 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ecd48adf136733979b49e15bc3b4c43cc0d3c85ece7bd08e6daa414c6fcb13e6"
|
"checksum console 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)" = "2bf3720d3f3fc30b721ef1ae54e13af3264af4af39dc476a8de56a6ee1e2184b"
|
||||||
|
"checksum constant_time_eq 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8ff012e225ce166d4422e0e78419d901719760f62ae2b7969ca6b564d1b54a9e"
|
||||||
"checksum content_inspector 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "b7bda66e858c683005a53a9a60c69a4aca7eeaa45d124526e389f7aec8e62f38"
|
"checksum content_inspector 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "b7bda66e858c683005a53a9a60c69a4aca7eeaa45d124526e389f7aec8e62f38"
|
||||||
"checksum crc 1.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d663548de7f5cca343f1e0a48d14dcfb0e9eb4e079ec58883b7251539fa10aeb"
|
"checksum crc 1.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d663548de7f5cca343f1e0a48d14dcfb0e9eb4e079ec58883b7251539fa10aeb"
|
||||||
"checksum difference 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "524cbf6897b527295dff137cec09ecf3a05f4fddffd7dfcd1585403449e74198"
|
"checksum difference 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "524cbf6897b527295dff137cec09ecf3a05f4fddffd7dfcd1585403449e74198"
|
||||||
"checksum directories 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "72d337a64190607d4fcca2cb78982c5dd57f4916e19696b48a575fa746b6cb0f"
|
"checksum dirs 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "88972de891f6118092b643d85a0b28e0678e0f948d7f879aa32f2d5aafe97d2a"
|
||||||
|
"checksum encode_unicode 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "90b2c9496c001e8cb61827acdefad780795c42264c137744cae6f7d9e3450abd"
|
||||||
"checksum encoding 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)" = "6b0d943856b990d12d3b55b359144ff341533e516d94098b1d3fc1ac666d36ec"
|
"checksum encoding 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)" = "6b0d943856b990d12d3b55b359144ff341533e516d94098b1d3fc1ac666d36ec"
|
||||||
"checksum encoding-index-japanese 1.20141219.5 (registry+https://github.com/rust-lang/crates.io-index)" = "04e8b2ff42e9a05335dbf8b5c6f7567e5591d0d916ccef4e0b1710d32a0d0c91"
|
"checksum encoding-index-japanese 1.20141219.5 (registry+https://github.com/rust-lang/crates.io-index)" = "04e8b2ff42e9a05335dbf8b5c6f7567e5591d0d916ccef4e0b1710d32a0d0c91"
|
||||||
"checksum encoding-index-korean 1.20141219.5 (registry+https://github.com/rust-lang/crates.io-index)" = "4dc33fb8e6bcba213fe2f14275f0963fd16f0a02c878e3095ecfdf5bee529d81"
|
"checksum encoding-index-korean 1.20141219.5 (registry+https://github.com/rust-lang/crates.io-index)" = "4dc33fb8e6bcba213fe2f14275f0963fd16f0a02c878e3095ecfdf5bee529d81"
|
||||||
@@ -999,22 +1119,23 @@ dependencies = [
|
|||||||
"checksum encoding-index-tradchinese 1.20141219.5 (registry+https://github.com/rust-lang/crates.io-index)" = "fd0e20d5688ce3cab59eb3ef3a2083a5c77bf496cb798dc6fcdb75f323890c18"
|
"checksum encoding-index-tradchinese 1.20141219.5 (registry+https://github.com/rust-lang/crates.io-index)" = "fd0e20d5688ce3cab59eb3ef3a2083a5c77bf496cb798dc6fcdb75f323890c18"
|
||||||
"checksum encoding_index_tests 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "a246d82be1c9d791c5dfde9a2bd045fc3cbba3fa2b11ad558f27d01712f00569"
|
"checksum encoding_index_tests 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "a246d82be1c9d791c5dfde9a2bd045fc3cbba3fa2b11ad558f27d01712f00569"
|
||||||
"checksum error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "07e791d3be96241c77c43846b665ef1384606da2cd2a48730abe606a12906e02"
|
"checksum error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "07e791d3be96241c77c43846b665ef1384606da2cd2a48730abe606a12906e02"
|
||||||
"checksum escargot 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "19db1f7e74438642a5018cdf263bb1325b2e792f02dd0a3ca6d6c0f0d7b1d5a5"
|
"checksum escargot 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ceb9adbf9874d5d028b5e4c5739d22b71988252b25c9c98fe7cf9738bee84597"
|
||||||
|
"checksum failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "795bd83d3abeb9220f257e597aa0080a508b27533824adf336529648f6abf7e2"
|
||||||
|
"checksum failure_derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "ea1063915fd7ef4309e222a5a07cf9c319fb9c7836b1f89b85458672dbb127e1"
|
||||||
"checksum flate2 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "3b0c7353385f92079524de3b7116cf99d73947c08a7472774e9b3b04bff3b901"
|
"checksum flate2 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "3b0c7353385f92079524de3b7116cf99d73947c08a7472774e9b3b04bff3b901"
|
||||||
"checksum fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3"
|
"checksum fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3"
|
||||||
"checksum fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82"
|
"checksum fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82"
|
||||||
"checksum fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7"
|
"checksum fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7"
|
||||||
"checksum git2 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)" = "591f8be1674b421644b6c030969520bc3fa12114d2eb467471982ed3e9584e71"
|
"checksum git2 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c7339329bfa14a00223244311560d11f8f489b453fb90092af97f267a6090ab0"
|
||||||
"checksum glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "8be18de09a56b60ed0edf84bc9df007e30040691af7acd1c41874faac5895bfb"
|
"checksum glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "8be18de09a56b60ed0edf84bc9df007e30040691af7acd1c41874faac5895bfb"
|
||||||
"checksum humantime 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0484fda3e7007f2a4a0d9c3a703ca38c71c54c55602ce4660c419fd32e188c9e"
|
"checksum humantime 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0484fda3e7007f2a4a0d9c3a703ca38c71c54c55602ce4660c419fd32e188c9e"
|
||||||
"checksum idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e"
|
"checksum idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e"
|
||||||
"checksum itoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "1306f3464951f30e30d12373d31c79fbd52d236e5e896fd92f96ec7babbbe60b"
|
"checksum itoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "1306f3464951f30e30d12373d31c79fbd52d236e5e896fd92f96ec7babbbe60b"
|
||||||
"checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d"
|
"checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d"
|
||||||
"checksum lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "76f033c7ad61445c5b347c7382dd1237847eb1bce590fe50365dcb33d546be73"
|
|
||||||
"checksum lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a374c89b9db55895453a74c1e38861d9deec0b01b405a82516e9d5de4820dea1"
|
"checksum lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a374c89b9db55895453a74c1e38861d9deec0b01b405a82516e9d5de4820dea1"
|
||||||
"checksum lazycell 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ddba4c30a78328befecec92fc94970e53b3ae385827d28620f0f5bb2493081e0"
|
"checksum lazycell 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ddba4c30a78328befecec92fc94970e53b3ae385827d28620f0f5bb2493081e0"
|
||||||
"checksum libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)" = "76e3a3ef172f1a0b9a9ff0dd1491ae5e6c948b94479a3021819ba7d860c8645d"
|
"checksum libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)" = "76e3a3ef172f1a0b9a9ff0dd1491ae5e6c948b94479a3021819ba7d860c8645d"
|
||||||
"checksum libgit2-sys 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4916b5addc78ec36cc309acfcdf0b9f9d97ab7b84083118b248709c5b7029356"
|
"checksum libgit2-sys 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)" = "48441cb35dc255da8ae72825689a95368bf510659ae1ad55dc4aa88cb1789bf1"
|
||||||
"checksum libz-sys 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)" = "2eb5e43362e38e2bca2fd5f5134c4d4564a23a5c28e9b95411652021a8675ebe"
|
"checksum libz-sys 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)" = "2eb5e43362e38e2bca2fd5f5134c4d4564a23a5c28e9b95411652021a8675ebe"
|
||||||
"checksum linked-hash-map 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "70fb39025bc7cdd76305867c4eccf2f2dcf6e9a57f5b21a93e1c2d86cd03ec9e"
|
"checksum linked-hash-map 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "70fb39025bc7cdd76305867c4eccf2f2dcf6e9a57f5b21a93e1c2d86cd03ec9e"
|
||||||
"checksum lock_api 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "775751a3e69bde4df9b38dd00a1b5d6ac13791e4223d4a0506577f0dd27cfb7a"
|
"checksum lock_api 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "775751a3e69bde4df9b38dd00a1b5d6ac13791e4223d4a0506577f0dd27cfb7a"
|
||||||
@@ -1024,6 +1145,7 @@ dependencies = [
|
|||||||
"checksum miniz-sys 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "0300eafb20369952951699b68243ab4334f4b10a88f411c221d444b36c40e649"
|
"checksum miniz-sys 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "0300eafb20369952951699b68243ab4334f4b10a88f411c221d444b36c40e649"
|
||||||
"checksum miniz_oxide 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5ad30a47319c16cde58d0314f5d98202a80c9083b5f61178457403dfb14e509c"
|
"checksum miniz_oxide 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5ad30a47319c16cde58d0314f5d98202a80c9083b5f61178457403dfb14e509c"
|
||||||
"checksum miniz_oxide_c_api 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "28edaef377517fd9fe3e085c37d892ce7acd1fbeab9239c5a36eec352d8a8b7e"
|
"checksum miniz_oxide_c_api 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "28edaef377517fd9fe3e085c37d892ce7acd1fbeab9239c5a36eec352d8a8b7e"
|
||||||
|
"checksum nodrop 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "2f9667ddcc6cc8a43afc9b7917599d7216aa09c463919ea32c59ed6cac8bc945"
|
||||||
"checksum onig 4.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3febe8cb22362af9e662c9c35e4d8a675de50b1b119823aa556892ac967fb776"
|
"checksum onig 4.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3febe8cb22362af9e662c9c35e4d8a675de50b1b119823aa556892ac967fb776"
|
||||||
"checksum onig_sys 69.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "78c04019a39ebac42dfd8c7822af0a009043720845a812ddbb95e403298b0183"
|
"checksum onig_sys 69.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "78c04019a39ebac42dfd8c7822af0a009043720845a812ddbb95e403298b0183"
|
||||||
"checksum owning_ref 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "cdf84f41639e037b484f93433aa3897863b561ed65c6e59c7073d7c561710f37"
|
"checksum owning_ref 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "cdf84f41639e037b484f93433aa3897863b561ed65c6e59c7073d7c561710f37"
|
||||||
@@ -1044,13 +1166,16 @@ dependencies = [
|
|||||||
"checksum rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0905b6b7079ec73b314d4c748701f6931eb79fd97c668caa3f1899b22b32c6db"
|
"checksum rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0905b6b7079ec73b314d4c748701f6931eb79fd97c668caa3f1899b22b32c6db"
|
||||||
"checksum redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)" = "c214e91d3ecf43e9a4e41e578973adeb14b474f2bee858742d127af75a0112b1"
|
"checksum redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)" = "c214e91d3ecf43e9a4e41e578973adeb14b474f2bee858742d127af75a0112b1"
|
||||||
"checksum redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76"
|
"checksum redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76"
|
||||||
|
"checksum redox_users 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "214a97e49be64fd2c86f568dd0cb2c757d2cc53de95b273b6ad0a1c908482f26"
|
||||||
"checksum regex 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "ee84f70c8c08744ea9641a731c7fadb475bf2ecc52d7f627feb833e0b3990467"
|
"checksum regex 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "ee84f70c8c08744ea9641a731c7fadb475bf2ecc52d7f627feb833e0b3990467"
|
||||||
"checksum regex-syntax 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "fbc557aac2b708fe84121caf261346cc2eed71978024337e42eb46b8a252ac6e"
|
"checksum regex-syntax 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "fbc557aac2b708fe84121caf261346cc2eed71978024337e42eb46b8a252ac6e"
|
||||||
"checksum remove_dir_all 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3488ba1b9a2084d38645c4c08276a1752dcbf2c7130d74f1569681ad5d2799c5"
|
"checksum remove_dir_all 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3488ba1b9a2084d38645c4c08276a1752dcbf2c7130d74f1569681ad5d2799c5"
|
||||||
|
"checksum rustc-demangle 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "adacaae16d02b6ec37fdc7acfcddf365978de76d1983d3ee22afc260e1ca9619"
|
||||||
"checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a"
|
"checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a"
|
||||||
"checksum ryu 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "eb9e9b8cde282a9fe6a42dd4681319bfb63f121b8a8ee9439c6f4107e58a46f7"
|
"checksum ryu 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "eb9e9b8cde282a9fe6a42dd4681319bfb63f121b8a8ee9439c6f4107e58a46f7"
|
||||||
"checksum safemem 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8dca453248a96cb0749e36ccdfe2b0b4e54a61bfef89fb97ec621eb8e0a93dd9"
|
"checksum safemem 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8dca453248a96cb0749e36ccdfe2b0b4e54a61bfef89fb97ec621eb8e0a93dd9"
|
||||||
"checksum same-file 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8f20c4be53a8a1ff4c1f1b2bd14570d2f634628709752f0702ecdd2b3f9a5267"
|
"checksum same-file 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8f20c4be53a8a1ff4c1f1b2bd14570d2f634628709752f0702ecdd2b3f9a5267"
|
||||||
|
"checksum scoped_threadpool 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "1d51f5df5af43ab3f1360b429fa5e0152ac5ce8c0bd6485cae490332e96846a8"
|
||||||
"checksum scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "94258f53601af11e6a49f722422f6e3425c52b06245a5cf9bc09908b174f5e27"
|
"checksum scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "94258f53601af11e6a49f722422f6e3425c52b06245a5cf9bc09908b174f5e27"
|
||||||
"checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403"
|
"checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403"
|
||||||
"checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3"
|
"checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3"
|
||||||
@@ -1062,6 +1187,7 @@ dependencies = [
|
|||||||
"checksum stable_deref_trait 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dba1a27d3efae4351c8051072d619e3ade2820635c3958d826bfea39d59b54c8"
|
"checksum stable_deref_trait 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dba1a27d3efae4351c8051072d619e3ade2820635c3958d826bfea39d59b54c8"
|
||||||
"checksum strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bb4f380125926a99e52bc279241539c018323fab05ad6368b56f93d9369ff550"
|
"checksum strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bb4f380125926a99e52bc279241539c018323fab05ad6368b56f93d9369ff550"
|
||||||
"checksum syn 0.15.19 (registry+https://github.com/rust-lang/crates.io-index)" = "39054bb43f2c5e4f3aef47718a391bf397c1b820fefc86f467d4d354f67bf7ef"
|
"checksum syn 0.15.19 (registry+https://github.com/rust-lang/crates.io-index)" = "39054bb43f2c5e4f3aef47718a391bf397c1b820fefc86f467d4d354f67bf7ef"
|
||||||
|
"checksum synstructure 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "73687139bf99285483c96ac0add482c3776528beac1d97d444f6e91f203a2015"
|
||||||
"checksum syntect 3.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e02dd9df97a68a2d005ace28ff24c610abfc3ce17afcfdb22a077645dabb599a"
|
"checksum syntect 3.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e02dd9df97a68a2d005ace28ff24c610abfc3ce17afcfdb22a077645dabb599a"
|
||||||
"checksum tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)" = "15f2b5fb00ccdf689e0149d1b1b3c03fead81c2b37735d812fa8bddbbf41b6d8"
|
"checksum tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)" = "15f2b5fb00ccdf689e0149d1b1b3c03fead81c2b37735d812fa8bddbbf41b6d8"
|
||||||
"checksum term_size 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9e5b9a66db815dcfd2da92db471106457082577c3c278d4138ab3e3b4e189327"
|
"checksum term_size 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9e5b9a66db815dcfd2da92db471106457082577c3c278d4138ab3e3b4e189327"
|
||||||
|
|||||||
+6
-6
@@ -7,7 +7,7 @@ license = "MIT/Apache-2.0"
|
|||||||
name = "bat"
|
name = "bat"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
repository = "https://github.com/sharkdp/bat"
|
repository = "https://github.com/sharkdp/bat"
|
||||||
version = "0.9.0"
|
version = "0.10.0"
|
||||||
exclude = [
|
exclude = [
|
||||||
"assets/syntaxes/*",
|
"assets/syntaxes/*",
|
||||||
"assets/themes/*",
|
"assets/themes/*",
|
||||||
@@ -18,8 +18,8 @@ build = "build.rs"
|
|||||||
atty = "0.2.2"
|
atty = "0.2.2"
|
||||||
ansi_term = "0.11"
|
ansi_term = "0.11"
|
||||||
ansi_colours = "^1.0"
|
ansi_colours = "^1.0"
|
||||||
console = "0.6"
|
console = "0.7"
|
||||||
directories = "1.0"
|
dirs = "1.0"
|
||||||
lazy_static = "1.2"
|
lazy_static = "1.2"
|
||||||
wild = "2.0"
|
wild = "2.0"
|
||||||
content_inspector = "0.2.4"
|
content_inspector = "0.2.4"
|
||||||
@@ -27,7 +27,7 @@ encoding = "0.2"
|
|||||||
shell-words = "0.1.0"
|
shell-words = "0.1.0"
|
||||||
|
|
||||||
[dependencies.git2]
|
[dependencies.git2]
|
||||||
version = "0.7"
|
version = "0.8"
|
||||||
default-features = false
|
default-features = false
|
||||||
features = []
|
features = []
|
||||||
|
|
||||||
@@ -48,8 +48,8 @@ features = []
|
|||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
tempdir = "0.3"
|
tempdir = "0.3"
|
||||||
assert_cmd = "0.10.1"
|
assert_cmd = "0.11.0"
|
||||||
escargot = "0.3.1"
|
escargot = "0.4.0"
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
clap = "2.32"
|
clap = "2.32"
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
Copyright (c) 2018 bat-developers (https://github.com/sharkdp/bat).
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
in the Software without restriction, including without limitation the rights
|
in the Software without restriction, including without limitation the rights
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
<a href="#installation">Installation</a> •
|
<a href="#installation">Installation</a> •
|
||||||
<a href="#customization">Customization</a> •
|
<a href="#customization">Customization</a> •
|
||||||
<a href="#project-goals-and-alternatives">Project goals, alternatives</a> •
|
<a href="#project-goals-and-alternatives">Project goals, alternatives</a> •
|
||||||
Translation [<a href="https://github.com/chinanf-boy/bat-zh">中文</a>]
|
Translation [<a href="https://github.com/chinanf-boy/bat-zh">中文</a>][<a href="doc/README-ja.md">日本文</a>]
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
### Syntax highlighting
|
### Syntax highlighting
|
||||||
@@ -32,7 +32,10 @@ languages:
|
|||||||
|
|
||||||
### Show non-printable characters
|
### Show non-printable characters
|
||||||
|
|
||||||

|
You can use the `-A`/`--show-all` option to show and highlight non-printable
|
||||||
|
characters:
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
### Automatic paging
|
### Automatic paging
|
||||||
|
|
||||||
@@ -41,8 +44,9 @@ languages:
|
|||||||
### File concatenation
|
### File concatenation
|
||||||
|
|
||||||
Oh.. you can also use it to concatenate files :wink:. Whenever
|
Oh.. you can also use it to concatenate files :wink:. Whenever
|
||||||
`bat` detects a non-interactive terminal, it will fall back to printing
|
`bat` detects a non-interactive terminal (i.e. when you pipe into another process
|
||||||
the plain file contents.
|
or into a file), `bat` will act as a drop-in replacement for `cat` and
|
||||||
|
fall back to printing the plain file contents.
|
||||||
|
|
||||||
## How to use
|
## How to use
|
||||||
|
|
||||||
@@ -70,8 +74,12 @@ Read from stdin, specify the language explicitly
|
|||||||
> yaml2json .travis.yml | json_pp | bat -l json
|
> yaml2json .travis.yml | json_pp | bat -l json
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Show and highlight non-printable characters:
|
||||||
|
```bash
|
||||||
|
> bat -A /etc/hosts
|
||||||
|
```
|
||||||
|
|
||||||
As a replacement for `cat`:
|
Use it as a `cat` replacement:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
bat > note.md # quickly create a new file
|
bat > note.md # quickly create a new file
|
||||||
@@ -91,7 +99,7 @@ bat f - g # output 'f', then stdin, then 'g'.
|
|||||||
Download the latest `.deb` package from the [release page](https://github.com/sharkdp/bat/releases)
|
Download the latest `.deb` package from the [release page](https://github.com/sharkdp/bat/releases)
|
||||||
and install it via:
|
and install it via:
|
||||||
``` bash
|
``` bash
|
||||||
sudo dpkg -i bat_0.9.0_amd64.deb # adapt version number and architecture
|
sudo dpkg -i bat_0.10.0_amd64.deb # adapt version number and architecture
|
||||||
```
|
```
|
||||||
|
|
||||||
### On Arch Linux
|
### On Arch Linux
|
||||||
@@ -103,6 +111,14 @@ from the official sources:
|
|||||||
pacman -S bat
|
pacman -S bat
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### On Fedora
|
||||||
|
|
||||||
|
You can install `bat` from the [Fedora Modular](https://docs.fedoraproject.org/en-US/modularity/using-modules/) repository. On Fedora 29 and higher, it is enabled by default. Otherwise, run `dnf install fedora-repos-modular` to set up, and make sure that the `fedora-modular` and `fedora-updates-modular` repos are enabled in `/etc/yum.repos.d`.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
dnf module install bat
|
||||||
|
```
|
||||||
|
|
||||||
### On Void Linux
|
### On Void Linux
|
||||||
|
|
||||||
You can install `bat` via xbps-install:
|
You can install `bat` via xbps-install:
|
||||||
@@ -200,12 +216,11 @@ This should work with the following distributions:
|
|||||||
|
|
||||||
Check out the [Release page](https://github.com/sharkdp/bat/releases) for
|
Check out the [Release page](https://github.com/sharkdp/bat/releases) for
|
||||||
prebuilt versions of `bat` for many different architectures. Statically-linked
|
prebuilt versions of `bat` for many different architectures. Statically-linked
|
||||||
binaries are available, just look for releases with `musl` in the name on the
|
binaries are also available: look for archives with `musl` in the file name.
|
||||||
releases page.
|
|
||||||
|
|
||||||
### From source
|
### From source
|
||||||
|
|
||||||
If you want to build `bat` from source, you need Rust 1.29 or
|
If you want to build `bat` from source, you need Rust 1.30 or
|
||||||
higher. You can then use `cargo` to build everything:
|
higher. You can then use `cargo` to build everything:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
@@ -223,7 +238,8 @@ Use `bat --list-themes` to get a list of all available themes for syntax
|
|||||||
highlighting. To select the `TwoDark` theme, call `bat` with the
|
highlighting. To select the `TwoDark` theme, call `bat` with the
|
||||||
`--theme=TwoDark` option or set the `BAT_THEME` environment variable to
|
`--theme=TwoDark` option or set the `BAT_THEME` environment variable to
|
||||||
`TwoDark`. Use `export BAT_THEME="TwoDark"` in your shell's startup file to
|
`TwoDark`. Use `export BAT_THEME="TwoDark"` in your shell's startup file to
|
||||||
make the change permanent.
|
make the change permanent. Alternatively, use `bat`s
|
||||||
|
[configuration file](https://github.com/sharkdp/bat#configuration-file).
|
||||||
|
|
||||||
If you want to preview the different themes on a custom file, you can use
|
If you want to preview the different themes on a custom file, you can use
|
||||||
the following command (you need [`fzf`](https://github.com/junegunn/fzf) for this):
|
the following command (you need [`fzf`](https://github.com/junegunn/fzf) for this):
|
||||||
@@ -232,16 +248,17 @@ bat --list-themes | fzf --preview="bat --theme={} --color=always /path/to/file"
|
|||||||
```
|
```
|
||||||
|
|
||||||
`bat` looks good on a dark background by default. However, if your terminal uses a
|
`bat` looks good on a dark background by default. However, if your terminal uses a
|
||||||
light background, some themes will work better for you. For example, the `GitHub`
|
light background, some themes like `GitHub` or `OneHalfLight` will work better for you.
|
||||||
theme is made for light backgrounds. You can also make your own theme by following the
|
You can also use a custom theme by following the
|
||||||
['Adding new themes' section below](https://github.com/sharkdp/bat#adding-new-themes).
|
['Adding new themes' section below](https://github.com/sharkdp/bat#adding-new-themes).
|
||||||
|
|
||||||
### Output style
|
### Output style
|
||||||
|
|
||||||
You can use the `--style` option to control the appearance of `bat`s output.
|
You can use the `--style` option to control the appearance of `bat`s output.
|
||||||
You can use `--style=numbers,changes`, for example, to show only Git changes
|
You can use `--style=numbers,changes`, for example, to show only Git changes
|
||||||
and line numbers but no grid and no file header. Use the `BAT_STYLE` environment
|
and line numbers but no grid and no file header. Set the `BAT_STYLE` environment
|
||||||
variable to make these changes permanent.
|
variable to make these changes permanent or use `bat`s
|
||||||
|
[configuration file](https://github.com/sharkdp/bat#configuration-file).
|
||||||
|
|
||||||
### Adding new syntaxes / language definitions
|
### Adding new syntaxes / language definitions
|
||||||
|
|
||||||
@@ -253,10 +270,8 @@ and theme. To add new syntax definitions, do the following.
|
|||||||
Create a folder with syntax definition files:
|
Create a folder with syntax definition files:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
BAT_CONFIG_DIR="$(bat cache --config-dir)"
|
mkdir -p "$(bat --config-dir)/syntaxes"
|
||||||
|
cd "$(bat --config-dir)/syntaxes"
|
||||||
mkdir -p "$BAT_CONFIG_DIR/syntaxes"
|
|
||||||
cd "$BAT_CONFIG_DIR/syntaxes"
|
|
||||||
|
|
||||||
# Put new '.sublime-syntax' language definition files
|
# Put new '.sublime-syntax' language definition files
|
||||||
# in this folder (or its subdirectories), for example:
|
# in this folder (or its subdirectories), for example:
|
||||||
@@ -266,7 +281,7 @@ git clone https://github.com/tellnobody1/sublime-purescript-syntax
|
|||||||
Now use the following command to parse these files into a binary cache:
|
Now use the following command to parse these files into a binary cache:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
bat cache --init
|
bat cache --build
|
||||||
```
|
```
|
||||||
|
|
||||||
Finally, use `bat --list-languages` to check if the new languages are available.
|
Finally, use `bat --list-languages` to check if the new languages are available.
|
||||||
@@ -283,16 +298,14 @@ This works very similar to how we add new syntax definitions.
|
|||||||
|
|
||||||
First, create a folder with the new syntax highlighting themes:
|
First, create a folder with the new syntax highlighting themes:
|
||||||
```bash
|
```bash
|
||||||
BAT_CONFIG_DIR="$(bat cache --config-dir)"
|
mkdir -p "$(bat --config-dir)/themes"
|
||||||
|
cd "$(bat --config-dir)/themes"
|
||||||
mkdir -p "$BAT_CONFIG_DIR/themes"
|
|
||||||
cd "$BAT_CONFIG_DIR/themes"
|
|
||||||
|
|
||||||
# Download a theme in '.tmTheme' format, for example:
|
# Download a theme in '.tmTheme' format, for example:
|
||||||
git clone https://github.com/greggb/sublime-snazzy
|
git clone https://github.com/greggb/sublime-snazzy
|
||||||
|
|
||||||
# Update the binary cache
|
# Update the binary cache
|
||||||
bat cache --init
|
bat cache --build
|
||||||
```
|
```
|
||||||
|
|
||||||
Finally, use `bat --list-themes` to check if the new themes are available.
|
Finally, use `bat --list-themes` to check if the new themes are available.
|
||||||
@@ -311,7 +324,9 @@ If you want to pass command-line arguments to the pager, you can also set them v
|
|||||||
export BAT_PAGER="less -RF"
|
export BAT_PAGER="less -RF"
|
||||||
```
|
```
|
||||||
|
|
||||||
**Note**: By default, if the pager is set to `less` (any no command-line options are specified),
|
Instead of using environment variables, you can also use `bat`s [configuration file](https://github.com/sharkdp/bat#configuration-file) to configure the pager (`--pager` option).
|
||||||
|
|
||||||
|
**Note**: By default, if the pager is set to `less` (and no command-line options are specified),
|
||||||
`bat` will pass the following command line
|
`bat` will pass the following command line
|
||||||
options to the pager: `-R`/`--RAW-CONTROL-CHARS`, `-F`/`--quit-if-one-screen` and `-X`/`--no-init`.
|
options to the pager: `-R`/`--RAW-CONTROL-CHARS`, `-F`/`--quit-if-one-screen` and `-X`/`--no-init`.
|
||||||
The first (`-R`) is needed to interpret ANSI colors correctly. The second option (`-F`) instructs
|
The first (`-R`) is needed to interpret ANSI colors correctly. The second option (`-F`) instructs
|
||||||
@@ -325,19 +340,21 @@ will hopefully enable both quit-if-one-screen and mouse-wheel scrolling.
|
|||||||
|
|
||||||
If scrolling still doesn't work for you, you can try to pass the `-S` option in addition.
|
If scrolling still doesn't work for you, you can try to pass the `-S` option in addition.
|
||||||
|
|
||||||
### Configuration file
|
## Configuration file
|
||||||
|
|
||||||
`bat` can also be customized with a configuration file. The location of the file is dependent on you operating system. To get the default path for your system, call
|
`bat` can also be customized with a configuration file. The location of the file is dependent
|
||||||
|
on your operating system. To get the default path for your system, call
|
||||||
```
|
```
|
||||||
bat --config-file
|
bat --config-file
|
||||||
```
|
```
|
||||||
|
|
||||||
Alternatively, you can use the `BAT_CONFIG_PATH` environment variable to point `bat` to a non-default location of the configuration file:
|
Alternatively, you can use the `BAT_CONFIG_PATH` environment variable to point `bat` to a
|
||||||
|
non-default location of the configuration file:
|
||||||
```bash
|
```bash
|
||||||
export BAT_CONFIG_PATH="/path/to/bat.conf"
|
export BAT_CONFIG_PATH="/path/to/bat.conf"
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Format
|
### Format
|
||||||
|
|
||||||
The configuration file is a simple list of command line arguments. Use `bat --help` to see a full list of possible options and values. In addition, you can add comments by prepending a line with the `#` character.
|
The configuration file is a simple list of command line arguments. Use `bat --help` to see a full list of possible options and values. In addition, you can add comments by prepending a line with the `#` character.
|
||||||
|
|
||||||
@@ -374,14 +391,14 @@ for `less` [from its homepage](http://www.greenwoodsoftware.com/less/download.ht
|
|||||||
Chocolatey](https://chocolatey.org/packages/Less). To use it, place the binary in a directory in
|
Chocolatey](https://chocolatey.org/packages/Less). To use it, place the binary in a directory in
|
||||||
your `PATH` or [define an environment variable](#using-a-different-pager).
|
your `PATH` or [define an environment variable](#using-a-different-pager).
|
||||||
|
|
||||||
### Colours
|
### Colors
|
||||||
|
|
||||||
Windows 10 natively supports colours in both `conhost.exe` (Command Prompt) and PowerShell since
|
Windows 10 natively supports colors in both `conhost.exe` (Command Prompt) and PowerShell since
|
||||||
[v1511](https://en.wikipedia.org/wiki/Windows_10_version_history#Version_1511_(November_Update)), as
|
[v1511](https://en.wikipedia.org/wiki/Windows_10_version_history#Version_1511_(November_Update)), as
|
||||||
well as in newer versions of bash. On earlier versions of Windows, you can use
|
well as in newer versions of bash. On earlier versions of Windows, you can use
|
||||||
[Cmder](http://cmder.net/), which includes [ConEmu](https://conemu.github.io/).
|
[Cmder](http://cmder.net/), which includes [ConEmu](https://conemu.github.io/).
|
||||||
|
|
||||||
**Note:** The Git and MSYS versions of `less` do not correctly interpret colours on Windows. If you
|
**Note:** The Git and MSYS versions of `less` do not correctly interpret colors on Windows. If you
|
||||||
don’t have any other pagers installed, you can disable paging entirely by passing `--paging=never`
|
don’t have any other pagers installed, you can disable paging entirely by passing `--paging=never`
|
||||||
or by setting `BAT_PAGER` to an empty string.
|
or by setting `BAT_PAGER` to an empty string.
|
||||||
|
|
||||||
|
|||||||
Vendored
+1
@@ -0,0 +1 @@
|
|||||||
|
* linguist-vendored
|
||||||
Vendored
+9
-2
@@ -13,12 +13,15 @@ In order to add new syntaxes to `bat`, follow these steps:
|
|||||||
Sublime Text and convert it to a `.sublime-syntax` file via *Tools* -> *Developer* ->
|
Sublime Text and convert it to a `.sublime-syntax` file via *Tools* -> *Developer* ->
|
||||||
*New Syntax from XXX.tmLanguage...*. Save the new file in the `assets/syntaxes` folder.
|
*New Syntax from XXX.tmLanguage...*. Save the new file in the `assets/syntaxes` folder.
|
||||||
|
|
||||||
3. Run the `create.sh` script. It calls `bat cache --init` to parse all available
|
3. Run the `create.sh` script. It calls `bat cache --build` to parse all available
|
||||||
`.sublime-syntax` files and serialize them to a `syntaxes.bin` file (in this folder).
|
`.sublime-syntax` files and serialize them to a `syntaxes.bin` file (in this folder).
|
||||||
|
|
||||||
4. Re-compile `bat`. At compilation time, the `syntaxes.bin` file will be stored inside the
|
4. Re-compile `bat`. At compilation time, the `syntaxes.bin` file will be stored inside the
|
||||||
`bat` binary.
|
`bat` binary.
|
||||||
|
|
||||||
|
5. If you send a pull request with your changes, please do *not* include the changed `syntaxes.bin`
|
||||||
|
file. A new binary cache file will be created once before every new release of `bat`.
|
||||||
|
|
||||||
### Troubleshooting
|
### Troubleshooting
|
||||||
|
|
||||||
Make sure that the local cache does not interfere with the internally stored syntaxes and
|
Make sure that the local cache does not interfere with the internally stored syntaxes and
|
||||||
@@ -29,4 +32,8 @@ themes (`bat cache --clear`).
|
|||||||
The following files have been manually modified after converting from a `.tmLanguage` file:
|
The following files have been manually modified after converting from a `.tmLanguage` file:
|
||||||
|
|
||||||
* `Dart.sublime-syntax` => removed `#regex.dart` include.
|
* `Dart.sublime-syntax` => removed `#regex.dart` include.
|
||||||
* `INI.sublime-syntax` => added `.hgrc` and `hgrc` file types.
|
* `INI.sublime-syntax` => added `.hgrc`, `hgrc`, and `desktop` file types.
|
||||||
|
|
||||||
|
### Non-submodule additions
|
||||||
|
|
||||||
|
* `Assembly (x86_64)` has been manually added from https://github.com/13xforever/x86-assembly-textmate-bundle due to `git clone` recursion problems
|
||||||
|
|||||||
Vendored
+1
-1
@@ -11,6 +11,6 @@ JAVADOC_FILE="${ASSET_DIR}/syntaxes/Packages/Java/JavaDoc.sublime-syntax"
|
|||||||
JAVADOC_PATCH="${ASSET_DIR}/JavaDoc.sublime-syntax.patch"
|
JAVADOC_PATCH="${ASSET_DIR}/JavaDoc.sublime-syntax.patch"
|
||||||
patch "$JAVADOC_FILE" "$JAVADOC_PATCH"
|
patch "$JAVADOC_FILE" "$JAVADOC_PATCH"
|
||||||
|
|
||||||
bat cache --init --blank --source="$ASSET_DIR" --target="$ASSET_DIR"
|
bat cache --build --blank --source="$ASSET_DIR" --target="$ASSET_DIR"
|
||||||
|
|
||||||
patch -R "$JAVADOC_FILE" "$JAVADOC_PATCH"
|
patch -R "$JAVADOC_FILE" "$JAVADOC_PATCH"
|
||||||
|
|||||||
Vendored
BIN
Binary file not shown.
+1
Submodule assets/syntaxes/AsciiDoc added at d0089991e5
+283
@@ -0,0 +1,283 @@
|
|||||||
|
%YAML 1.2
|
||||||
|
---
|
||||||
|
# http://www.sublimetext.com/docs/3/syntax.html
|
||||||
|
name: AsciiDoc
|
||||||
|
comment: |
|
||||||
|
A very early hack. Mostly ripped from other syntaxes.
|
||||||
|
Only the very basic stuff is working.
|
||||||
|
file_extensions:
|
||||||
|
- adoc
|
||||||
|
- asciidoc
|
||||||
|
- asc
|
||||||
|
scope: text.html.asciidoc
|
||||||
|
contexts:
|
||||||
|
main:
|
||||||
|
- include: heading_inline
|
||||||
|
- include: heading-block
|
||||||
|
- include: heading-blockattr
|
||||||
|
- match: \$\$(?!\$)
|
||||||
|
push:
|
||||||
|
- meta_scope: comment.block.passthrough.macro.doubledollar.asciidoc
|
||||||
|
- match: \$\$(?!\$)
|
||||||
|
pop: true
|
||||||
|
- match: \+\+\+(?!\+)
|
||||||
|
push:
|
||||||
|
- meta_scope: comment.block.passthrough.macro.tripeplus.asciidoc
|
||||||
|
- match: \+\+\+(?!\+)
|
||||||
|
pop: true
|
||||||
|
- match: (//).*$\n?
|
||||||
|
scope: comment.line.double-slash.asciidoc
|
||||||
|
- match: |-
|
||||||
|
(?x)^
|
||||||
|
(?= ([/+-.*_=]{4,})\s*$
|
||||||
|
| ([ \t]{1,})
|
||||||
|
| [=]{1,6}\s*+
|
||||||
|
| [ ]{,3}(?<marker>[-*_])([ ]{,2}\k<marker>){2,}[ \t]*+$
|
||||||
|
)
|
||||||
|
push:
|
||||||
|
- meta_scope: meta.block-level.asciidoc
|
||||||
|
- match: |-
|
||||||
|
(?x)^
|
||||||
|
(?! \1
|
||||||
|
| ([ \t]{1,})
|
||||||
|
| [=]{1,6}\s*+
|
||||||
|
| [ ]{,3}(?<marker>[-*_])([ ]{,2}\k<marker>){2,}[ \t]*+$
|
||||||
|
)
|
||||||
|
pop: true
|
||||||
|
- include: block_quote
|
||||||
|
- include: block_raw
|
||||||
|
- include: heading_inline
|
||||||
|
- include: heading-block
|
||||||
|
- include: separator
|
||||||
|
- match: '^[ ]{0,3}([*+-])(?=\s)'
|
||||||
|
captures:
|
||||||
|
1: punctuation.definition.list_item.asciidoc
|
||||||
|
push:
|
||||||
|
- meta_scope: markup.list.unnumbered.asciidoc
|
||||||
|
- match: ^(?=\S)
|
||||||
|
captures:
|
||||||
|
1: punctuation.definition.list_item.asciidoc
|
||||||
|
pop: true
|
||||||
|
- include: list-paragraph
|
||||||
|
- match: '^[ ]{0,3}[0-9]+(\.)(?=\s)'
|
||||||
|
captures:
|
||||||
|
1: punctuation.definition.list_item.asciidoc
|
||||||
|
push:
|
||||||
|
- meta_scope: markup.list.numbered.asciidoc
|
||||||
|
- match: ^(?=\S)
|
||||||
|
captures:
|
||||||
|
1: punctuation.definition.list_item.asciidoc
|
||||||
|
pop: true
|
||||||
|
- include: list-paragraph
|
||||||
|
- match: '^([/+-.*_=]){4,}\s*$'
|
||||||
|
push:
|
||||||
|
- meta_scope: comment.block.asciidoc
|
||||||
|
- match: '^\1{4,}\s*$'
|
||||||
|
pop: true
|
||||||
|
- match: '^([/+.]){4,}\s*$'
|
||||||
|
comment: asciidoc formatting is disabled inside certain blocks.
|
||||||
|
push:
|
||||||
|
- meta_scope: meta.disable-asciidoc
|
||||||
|
- match: '^[/+.]{4,}\s*$'
|
||||||
|
pop: true
|
||||||
|
- match: '^(?=\S)(?![=-]{3,}(?=$))(?!\.\S+)'
|
||||||
|
push:
|
||||||
|
- meta_scope: meta.paragraph.asciidoc
|
||||||
|
- match: '^(?:\s*$|(?=[ ]{,3}>.))|(?=[ \t]*\n)(?<=^===|^====|=====|^---|^----|-----)[ \t]*\n'
|
||||||
|
pop: true
|
||||||
|
- include: inline
|
||||||
|
- include: scope:text.html.basic
|
||||||
|
- match: '^(={3,})(?=[ \t]*$)'
|
||||||
|
scope: markup.heading.0.asciidoc
|
||||||
|
captures:
|
||||||
|
1: punctuation.definition.heading.asciidoc
|
||||||
|
- match: '^(-{3,})(?=[ \t]*$)'
|
||||||
|
scope: markup.heading.1.asciidoc
|
||||||
|
captures:
|
||||||
|
1: punctuation.definition.heading.asciidoc
|
||||||
|
- match: '^(~{3,})(?=[ \t]*$)'
|
||||||
|
scope: markup.heading.2.asciidoc
|
||||||
|
captures:
|
||||||
|
1: punctuation.definition.heading.asciidoc
|
||||||
|
- match: '^(\^{3,})(?=[ \t]*$)'
|
||||||
|
scope: markup.heading.3.asciidoc
|
||||||
|
captures:
|
||||||
|
1: punctuation.definition.heading.asciidoc
|
||||||
|
- match: '^(\+{3,})(?=[ \t]*$)'
|
||||||
|
scope: markup.heading.4.asciidoc
|
||||||
|
captures:
|
||||||
|
1: punctuation.definition.heading.asciidoc
|
||||||
|
attribute-entry:
|
||||||
|
- match: '^:[-_. A-Za-z0-9]+:\s*(.*)\s*$'
|
||||||
|
scope: variable.other
|
||||||
|
attribute-reference:
|
||||||
|
- match: "{[-_. A-Za-z0-9]+}"
|
||||||
|
scope: variable.other
|
||||||
|
attribute-reference-predefined:
|
||||||
|
- match: "{(?i:amp|asciidoc-dir|asciidoc-file|asciidoc-version|author|authored|authorinitials|backend-docbook|backend-xhtml11|backend-html4|docbook-article|xhtml11-article|html4-article|docbook-book|xhtml11-book|html4-book|docbook-manpage|xhtml11-manpage|html4-manpage|backend|backslash|basebackend|brvbar|date|docdate|doctime|docname|docfile|docdir|doctitle|doctype-article|doctype-book|doctype-manpage|doctype|email|empty|encoding|filetype|firstname|gt|id|indir|infile|lastname|level|listindex|localdate|localtime|lt|manname|manpurpose|mantitle|manvolnum|middlename|nbsp|outdir|outfile|reftext|revision|sectnum|showcomments|title|two_colons|two_semicolons|user-dir|verbose)}"
|
||||||
|
scope: support.variable
|
||||||
|
block_quote:
|
||||||
|
- match: '^([/+-.*_=]){4,}\s*$'
|
||||||
|
push:
|
||||||
|
- meta_scope: comment.block.asciidoc
|
||||||
|
- match: '^\1{4,}\s*$'
|
||||||
|
pop: true
|
||||||
|
block_raw:
|
||||||
|
- match: '\G([ ]{4}|\t).*$\n?'
|
||||||
|
scope: markup.raw.block.asciidoc
|
||||||
|
bracket:
|
||||||
|
- match: '<(?![a-z/?\$!])'
|
||||||
|
comment: |
|
||||||
|
asciidoc will convert this for us. We match it so that the
|
||||||
|
HTML grammar will not mark it up as invalid.
|
||||||
|
scope: meta.other.valid-bracket.asciidoc
|
||||||
|
character-replacements:
|
||||||
|
- match: \(C\)|\(R\)|\(TM\)|--(?!-)|\.\.\.(?!\.)|->|<-|=>|<=
|
||||||
|
scope: constant.character.asciidoc
|
||||||
|
escape:
|
||||||
|
- match: '\\[-`*_#+.!(){}\[\]\\>:]'
|
||||||
|
scope: constant.character.escape.asciidoc
|
||||||
|
heading:
|
||||||
|
- match: '(?m)^(\S+)$([=-~^+])+\s*$'
|
||||||
|
scope: markup.heading.asciidoc
|
||||||
|
captures:
|
||||||
|
1: punctuation.definition.heading.asciidoc
|
||||||
|
heading-block:
|
||||||
|
- match: ^\.(\w.*)$
|
||||||
|
scope: markup.heading.asciidoc
|
||||||
|
captures:
|
||||||
|
1: punctuation.definition.heading.asciidoc
|
||||||
|
heading-blockattr:
|
||||||
|
- match: '^\[\[?(\w.*)\]$'
|
||||||
|
scope: markup.heading.asciidoc
|
||||||
|
captures:
|
||||||
|
1: punctuation.definition.heading.asciidoc
|
||||||
|
heading_inline:
|
||||||
|
- match: '\G(={1,6})(?!=)\s*(?=\S)'
|
||||||
|
captures:
|
||||||
|
1: punctuation.definition.heading.asciidoc
|
||||||
|
push:
|
||||||
|
- meta_scope: markup.heading.asciidoc
|
||||||
|
- meta_content_scope: entity.name.section.asciidoc
|
||||||
|
- match: \s*(=*)$\n?
|
||||||
|
captures:
|
||||||
|
1: punctuation.definition.heading.asciidoc
|
||||||
|
pop: true
|
||||||
|
- include: inline
|
||||||
|
inline:
|
||||||
|
- include: line-break
|
||||||
|
- include: line-page-break
|
||||||
|
- include: line-ruler
|
||||||
|
- include: escape
|
||||||
|
- include: passthrough-macro-trippleplus-inline
|
||||||
|
- include: passthrough-macro-doubledollar-inline
|
||||||
|
- include: character-replacements
|
||||||
|
- include: bracket
|
||||||
|
- include: raw
|
||||||
|
- include: text-quote-single
|
||||||
|
- include: text-quote-double
|
||||||
|
- include: text-quote-other
|
||||||
|
- include: text-bold-unconstrained
|
||||||
|
- include: text-italic-unconstrained
|
||||||
|
- include: text-monospace-unconstrained
|
||||||
|
- include: text-unquoted-unconstrained
|
||||||
|
- include: text-bold
|
||||||
|
- include: text-italic
|
||||||
|
- include: text-monospace
|
||||||
|
- include: text-unquoted
|
||||||
|
- include: attribute-entry
|
||||||
|
- include: attribute-reference-predefined
|
||||||
|
- include: attribute-reference
|
||||||
|
line-break:
|
||||||
|
- match: (?<=\S)\s+\+$
|
||||||
|
scope: constant.character.escape.asciidoc
|
||||||
|
line-page-break:
|
||||||
|
- match: "^<{3,}$"
|
||||||
|
scope: constant.character.escape.asciidoc
|
||||||
|
line-ruler:
|
||||||
|
- match: "^'{3,}$"
|
||||||
|
scope: constant.character.escape.asciidoc
|
||||||
|
list-paragraph:
|
||||||
|
- match: \G\s+(?=\S)
|
||||||
|
push:
|
||||||
|
- meta_scope: meta.paragraph.list.asciidoc
|
||||||
|
- match: ^\s*$
|
||||||
|
pop: true
|
||||||
|
- include: inline
|
||||||
|
passthrough-macro-doubledollar-inline:
|
||||||
|
- match: '(?:\[.*\])?\$\$(?!\$).+\$\$(?!\$)'
|
||||||
|
scope: comment.block.passthrough.asciidoc
|
||||||
|
passthrough-macro-trippleplus-inline:
|
||||||
|
- match: '(?:\[.*\])?\+\+\+(?!\+).+\+\+\+(?!\+)'
|
||||||
|
scope: comment.block.passthrough.asciidoc
|
||||||
|
raw:
|
||||||
|
- match: '(`+)(?:[^`]|(?!(?<!`)\1(?!`))`)*+(\1)'
|
||||||
|
scope: markup.raw.inline.asciidoc
|
||||||
|
captures:
|
||||||
|
1: punctuation.definition.raw.asciidoc
|
||||||
|
2: punctuation.definition.raw.asciidoc
|
||||||
|
separator:
|
||||||
|
- match: '\G[ ]{,3}([-*_])([ ]{,2}\1){2,}[ \t]*$\n?'
|
||||||
|
scope: meta.separator.asciidoc
|
||||||
|
text-bold:
|
||||||
|
- match: (?<!\w)(\*)(?=\S)
|
||||||
|
captures:
|
||||||
|
1: punctuation.definition.bold.asciidoc
|
||||||
|
push:
|
||||||
|
- meta_scope: markup.bold.asciidoc
|
||||||
|
- match: (?<=\S)(\1)(?!\w)
|
||||||
|
captures:
|
||||||
|
1: punctuation.definition.bold.asciidoc
|
||||||
|
pop: true
|
||||||
|
text-bold-unconstrained:
|
||||||
|
- match: (\*\*)(?=\S)
|
||||||
|
captures:
|
||||||
|
1: punctuation.definition.bold.asciidoc
|
||||||
|
push:
|
||||||
|
- meta_scope: markup.bold.asciidoc
|
||||||
|
- match: (?<=\S)(\1)
|
||||||
|
captures:
|
||||||
|
1: punctuation.definition.bold.asciidoc
|
||||||
|
pop: true
|
||||||
|
text-italic:
|
||||||
|
- match: (?<!\w)('|_)(?=\S)
|
||||||
|
captures:
|
||||||
|
1: punctuation.definition.italic.asciidoc
|
||||||
|
push:
|
||||||
|
- meta_scope: markup.italic.asciidoc
|
||||||
|
- match: (?<=\S)(\1)((?!\1)|(?=\1\1))(?!\w)
|
||||||
|
captures:
|
||||||
|
1: punctuation.definition.italic.asciidoc
|
||||||
|
pop: true
|
||||||
|
text-italic-unconstrained:
|
||||||
|
- match: (__)(?=\S)
|
||||||
|
captures:
|
||||||
|
1: punctuation.definition.italic.asciidoc
|
||||||
|
push:
|
||||||
|
- meta_scope: markup.italic.asciidoc
|
||||||
|
- match: (?<=\S)(\1)
|
||||||
|
captures:
|
||||||
|
1: punctuation.definition.italic.asciidoc
|
||||||
|
pop: true
|
||||||
|
text-monospace:
|
||||||
|
- match: '(?<!\w)([\+`])[^\+]*(\1)(?!\w)'
|
||||||
|
scope: string.interpolated.asciidoc
|
||||||
|
text-monospace-unconstrained:
|
||||||
|
- match: (\+\+).*(\1)
|
||||||
|
scope: string.interpolated.asciidoc
|
||||||
|
text-quote-double:
|
||||||
|
- match: '(?<!\w)(?:\[.*\])?``(?!`).*''''(?!'')(?!\w)'
|
||||||
|
scope: string.quoted.double.asciidoc
|
||||||
|
text-quote-other:
|
||||||
|
- match: '(?<!\w)(?:\[.*\])?([~^]).*(\1)(?!\w)'
|
||||||
|
scope: string.quoted.single.asciidoc
|
||||||
|
text-quote-single:
|
||||||
|
- match: '(?<!\w)(?:\[.*\])?`(?!`).*''(?!'')(?!\w)'
|
||||||
|
comment: "TODO: Sub- and Superscript are really unconstrained"
|
||||||
|
scope: string.quoted.single.asciidoc
|
||||||
|
text-unquoted:
|
||||||
|
- match: (?<!\w)(#).*(\1)(?!\w)
|
||||||
|
scope: string.unquoted.asciidoc
|
||||||
|
text-unquoted-unconstrained:
|
||||||
|
- match: (##).*(\1)
|
||||||
|
scope: string.unquoted.asciidoc
|
||||||
+1
Submodule assets/syntaxes/Assembly (ARM) added at 08f33d80de
+172
@@ -0,0 +1,172 @@
|
|||||||
|
%YAML 1.2
|
||||||
|
---
|
||||||
|
# http://www.sublimetext.com/docs/3/syntax.html
|
||||||
|
name: ARM Assembly
|
||||||
|
file_extensions:
|
||||||
|
- s
|
||||||
|
- S
|
||||||
|
scope: source.asm.arm
|
||||||
|
contexts:
|
||||||
|
main:
|
||||||
|
- match: "@.*$"
|
||||||
|
scope: comment.line
|
||||||
|
- match: //.*$
|
||||||
|
scope: comment.line
|
||||||
|
- match: ;.*$
|
||||||
|
scope: comment.line
|
||||||
|
- match: ^\s*\#\s*if\s+0\b
|
||||||
|
push:
|
||||||
|
- meta_scope: comment.preprocessor
|
||||||
|
- match: ^\s*\#\s*endif\b
|
||||||
|
pop: true
|
||||||
|
- match: /\*
|
||||||
|
push:
|
||||||
|
- meta_scope: comment.block
|
||||||
|
- match: \*/
|
||||||
|
pop: true
|
||||||
|
- match: |-
|
||||||
|
(?x)
|
||||||
|
^\s*\#\s*(define)\s+ # define
|
||||||
|
((?<id>[a-zA-Z_][a-zA-Z0-9_]*)) # macro name
|
||||||
|
(?: # and optionally:
|
||||||
|
(\() # an open parenthesis
|
||||||
|
(
|
||||||
|
\s* \g<id> \s* # first argument
|
||||||
|
((,) \s* \g<id> \s*)* # additional arguments
|
||||||
|
(?:\.\.\.)? # varargs ellipsis?
|
||||||
|
)
|
||||||
|
(\)) # a close parenthesis
|
||||||
|
)?
|
||||||
|
captures:
|
||||||
|
1: keyword.control.import.define.c
|
||||||
|
2: entity.name.function.preprocessor.c
|
||||||
|
4: punctuation.definition.parameters.c
|
||||||
|
5: variable.parameter.preprocessor.c
|
||||||
|
7: punctuation.separator.parameters.c
|
||||||
|
8: punctuation.definition.parameters.c
|
||||||
|
push:
|
||||||
|
- meta_scope: meta.preprocessor.macro.c
|
||||||
|
- match: (?=(?://|/\*))|$
|
||||||
|
pop: true
|
||||||
|
- match: (?>\\\s*\n)
|
||||||
|
scope: punctuation.separator.continuation.c
|
||||||
|
- include: $top_level_main
|
||||||
|
- match: ^\s*#\s*(error|warning)\b
|
||||||
|
captures:
|
||||||
|
1: keyword.control.import.error.c
|
||||||
|
push:
|
||||||
|
- meta_scope: meta.preprocessor.diagnostic.c
|
||||||
|
- match: $
|
||||||
|
captures:
|
||||||
|
1: keyword.control.import.error.c
|
||||||
|
pop: true
|
||||||
|
- match: (?>\\\s*\n)
|
||||||
|
scope: punctuation.separator.continuation.c
|
||||||
|
- match: ^\s*#\s*(include|import)\b\s+
|
||||||
|
captures:
|
||||||
|
1: keyword.control.import.include.c
|
||||||
|
push:
|
||||||
|
- meta_scope: meta.preprocessor.c.include
|
||||||
|
- match: (?=(?://|/\*))|$
|
||||||
|
captures:
|
||||||
|
1: keyword.control.import.include.c
|
||||||
|
pop: true
|
||||||
|
- match: (?>\\\s*\n)
|
||||||
|
scope: punctuation.separator.continuation.c
|
||||||
|
- match: '"'
|
||||||
|
captures:
|
||||||
|
0: punctuation.definition.string.begin.c
|
||||||
|
push:
|
||||||
|
- meta_scope: string.quoted.double.include.c
|
||||||
|
- match: '"'
|
||||||
|
captures:
|
||||||
|
0: punctuation.definition.string.end.c
|
||||||
|
pop: true
|
||||||
|
- match: <
|
||||||
|
captures:
|
||||||
|
0: punctuation.definition.string.begin.c
|
||||||
|
push:
|
||||||
|
- meta_scope: string.quoted.other.lt-gt.include.c
|
||||||
|
- match: ">"
|
||||||
|
captures:
|
||||||
|
0: punctuation.definition.string.end.c
|
||||||
|
pop: true
|
||||||
|
- match: '((?i)([xw][0-9]|[xw]1[0-9]||[xw]2[0-9]|[wx]30|wzr|xzr|wsp|fpsr|fpcr|[rcp]1[0-5]|[rcp][0-9]|a[1-4]|v[1-8]|sl|sb|fp|ip|sp|lr|(c|s)psr(_c)?|pc|[sd]3[0-1]|[sd][12][0-9]|[sd][0-9]|fpsid|fpscr|fpexc|q3[0-1]|q2[0-9]|q1[0-9]|q[0-9]|APSR_nzcv|sy)!?(?-i))?\b'
|
||||||
|
scope: storage.other.register
|
||||||
|
- match: \.(?i)(globl|global|macro|endm|purgem|if|elseif|else|endif|section|text|arm|align|balign|irp|rept|endr|req|unreq|error|short|func|endfunc|hidden|type|fpu|arch|code|altmacro|object_arch|word|int|string)(?-i)\b
|
||||||
|
scope: keyword.control.directive
|
||||||
|
- match: armv(2a?|3m?|4t?|5t?e?6(j|t2|zk?|-m)?|7v?e?(-(a|r|m))?|8-a(\+crc)?)
|
||||||
|
scope: keyword.control.arch.arm
|
||||||
|
- match: ^\s*#\s*(define|defined|elif|else|if|ifdef|ifndef|line|pragma|undef|endif)\b
|
||||||
|
captures:
|
||||||
|
1: keyword.control.import.c
|
||||||
|
push:
|
||||||
|
- meta_scope: meta.preprocessor.c
|
||||||
|
- match: (?=(?://|/\*))|$
|
||||||
|
captures:
|
||||||
|
1: keyword.control.import.c
|
||||||
|
pop: true
|
||||||
|
- match: (?>\\\s*\n)
|
||||||
|
scope: punctuation.separator.continuation.c
|
||||||
|
- match: |-
|
||||||
|
(?x)\b((?i)
|
||||||
|
(
|
||||||
|
(bf(c|i)|(u|s)bfx|(u|s)xta?(h|b)?) |
|
||||||
|
(v(add|cvt|sub|mov|trn|cmp|div|qdmulh|mrs|mul|ld1|qadd|qshrun|st[1234]|addw|mull|mlal|rshrn|swp|qmovun)|qmovun)(\.([isup]?8|[isupf]?16|[isuf]?32|[isu]?64))* |
|
||||||
|
(and|m(rs|sr)|eor|sub|rsb|add|adc|sbc|rsc|tst|teq|cmp|cmn|orr|mov|bic|mvn |
|
||||||
|
(neg) |
|
||||||
|
(lsr|lsl|ror|asr) # shift ops either pseudo ops or actual shifts
|
||||||
|
)s? |
|
||||||
|
(mul|mla|mull|smlabb) |
|
||||||
|
(mov(w|t)) |
|
||||||
|
rev(8|16)? |
|
||||||
|
(pld|adr|adrl|vswp)
|
||||||
|
)
|
||||||
|
(ne|eq|cs|hs|cc|lo|mi|pl|vs|vc|hi|ls|lt|le|gt|ge|al)?(?-i))?\b
|
||||||
|
scope: support.function.mnemonic.arithmetic
|
||||||
|
- match: |-
|
||||||
|
(?x)\b((?i)(
|
||||||
|
swi|svc|wfi|
|
||||||
|
dmb | clrex | dsb | isb |
|
||||||
|
v(ldr|str|push|pop) |
|
||||||
|
(push|pop) |
|
||||||
|
(st|ld)(
|
||||||
|
p |
|
||||||
|
r(ex|s?(h|b)|d)? |
|
||||||
|
m(
|
||||||
|
(f|e)(d|a) |
|
||||||
|
(d|i)(b|a)
|
||||||
|
)?
|
||||||
|
) |
|
||||||
|
b(l|x|lx|lr|r)? |
|
||||||
|
(i|e)?ret|
|
||||||
|
b\.(eq|ne|hs|cs|lo|cc|mi|pl|vs|vc|hi|ls|ge|lt|gt|le|al|nv)+ |
|
||||||
|
(c|t)?bn?z|
|
||||||
|
)+(ne|eq|cs|hs|cc|lo|mi|pl|vs|vc|hi|ls|lt|le|gt|ge|al)?(?-i))\b
|
||||||
|
scope: support.function.mnemonic.memory
|
||||||
|
- match: '\b((?i)(def(b|w|s)|equ|(include|get)(\s+([a-zA-Z_]+[0-9a-zA-Z_]*|[0-9]+[a-zA-Z_]+[0-9a-zA-Z_]*?)\.s)?)?(?-i))\b'
|
||||||
|
scope: meta.preprocessor.c.include
|
||||||
|
- match: \b((?i)(align)(?-i))?\b
|
||||||
|
scope: storage.type.c.memaccess
|
||||||
|
- match: \s+\".+\"
|
||||||
|
scope: string
|
||||||
|
- match: \b((?i)nop(ne|eq|cs|hs|cc|lo|mi|pl|vs|vc|hi|ls|lt|le|gt|ge|al)?(?-i))?\b
|
||||||
|
scope: comment.nop
|
||||||
|
- match: '\s\['
|
||||||
|
push:
|
||||||
|
- meta_scope: storage.type.c.memaccess
|
||||||
|
- match: '\]'
|
||||||
|
pop: true
|
||||||
|
- match: (?>\\\s*\n)
|
||||||
|
scope: punctuation.separator.continuation.c
|
||||||
|
- include: $top_level_main
|
||||||
|
- match: (\b|\s+)\=\b
|
||||||
|
scope: keyword.control.evaluation
|
||||||
|
- match: '(\b|\s+)(\#)?-?(0x|&)[0-9a-fA-F_]+\b'
|
||||||
|
scope: constant.numeric.hex
|
||||||
|
- match: '(\b|\s+)\#-?[0-9a-zA-Z_]+\b'
|
||||||
|
scope: constant.numeric.literal
|
||||||
|
- match: '(\b|\s+)[0-9]+\b'
|
||||||
|
scope: constant.numeric.dec
|
||||||
|
- match: '\b([a-zA-Z_]+[0-9a-zA-Z_]*|[0-9]+[a-zA-Z_]+[0-9a-zA-Z_]*)\b'
|
||||||
|
scope: meta.function.source.arm.label
|
||||||
+1367
File diff suppressed because it is too large
Load Diff
+662
@@ -0,0 +1,662 @@
|
|||||||
|
%YAML 1.2
|
||||||
|
---
|
||||||
|
# http://www.sublimetext.com/docs/3/syntax.html
|
||||||
|
name: HTML (Twig)
|
||||||
|
file_extensions:
|
||||||
|
- twig
|
||||||
|
- html.twig
|
||||||
|
scope: text.html.twig
|
||||||
|
contexts:
|
||||||
|
main:
|
||||||
|
- match: '(<)([a-zA-Z0-9:]++)(?=[^>]*></\2>)'
|
||||||
|
captures:
|
||||||
|
1: punctuation.definition.tag.html
|
||||||
|
2: entity.name.tag.html
|
||||||
|
push:
|
||||||
|
- meta_scope: meta.tag.any.html
|
||||||
|
- match: (>(<)/)(\2)(>)
|
||||||
|
captures:
|
||||||
|
1: punctuation.definition.tag.html
|
||||||
|
2: meta.scope.between-tag-pair.html
|
||||||
|
3: entity.name.tag.html
|
||||||
|
4: punctuation.definition.tag.html
|
||||||
|
pop: true
|
||||||
|
- include: tag-stuff
|
||||||
|
- match: (<\?)(xml)
|
||||||
|
captures:
|
||||||
|
1: punctuation.definition.tag.html
|
||||||
|
2: entity.name.tag.xml.html
|
||||||
|
push:
|
||||||
|
- meta_scope: meta.tag.preprocessor.xml.html
|
||||||
|
- match: (\?>)
|
||||||
|
captures:
|
||||||
|
1: punctuation.definition.tag.html
|
||||||
|
2: entity.name.tag.xml.html
|
||||||
|
pop: true
|
||||||
|
- include: tag-generic-attribute
|
||||||
|
- include: string-double-quoted
|
||||||
|
- include: string-single-quoted
|
||||||
|
- match: <!--
|
||||||
|
captures:
|
||||||
|
0: punctuation.definition.comment.html
|
||||||
|
push:
|
||||||
|
- meta_scope: comment.block.html
|
||||||
|
- match: '--\s*>'
|
||||||
|
captures:
|
||||||
|
0: punctuation.definition.comment.html
|
||||||
|
pop: true
|
||||||
|
- match: "--"
|
||||||
|
scope: invalid.illegal.bad-comments-or-CDATA.html
|
||||||
|
- include: embedded-code
|
||||||
|
- match: <!
|
||||||
|
captures:
|
||||||
|
0: punctuation.definition.tag.html
|
||||||
|
push:
|
||||||
|
- meta_scope: meta.tag.sgml.html
|
||||||
|
- match: ">"
|
||||||
|
captures:
|
||||||
|
0: punctuation.definition.tag.html
|
||||||
|
pop: true
|
||||||
|
- match: (?i:DOCTYPE)
|
||||||
|
captures:
|
||||||
|
1: entity.name.tag.doctype.html
|
||||||
|
push:
|
||||||
|
- meta_scope: meta.tag.sgml.doctype.html
|
||||||
|
- match: (?=>)
|
||||||
|
captures:
|
||||||
|
1: entity.name.tag.doctype.html
|
||||||
|
pop: true
|
||||||
|
- match: '"[^">]*"'
|
||||||
|
scope: string.quoted.double.doctype.identifiers-and-DTDs.html
|
||||||
|
- match: '\[CDATA\['
|
||||||
|
push:
|
||||||
|
- meta_scope: constant.other.inline-data.html
|
||||||
|
- match: "]](?=>)"
|
||||||
|
pop: true
|
||||||
|
- match: (\s*)(?!--|>)\S(\s*)
|
||||||
|
scope: invalid.illegal.bad-comments-or-CDATA.html
|
||||||
|
- include: embedded-code
|
||||||
|
- match: '(?:^\s+)?(<)((?i:style))\b(?![^>]*/>)'
|
||||||
|
captures:
|
||||||
|
1: punctuation.definition.tag.html
|
||||||
|
2: entity.name.tag.style.html
|
||||||
|
3: punctuation.definition.tag.html
|
||||||
|
push:
|
||||||
|
- meta_scope: source.css.embedded.html
|
||||||
|
- match: (</)((?i:style))(>)(?:\s*\n)?
|
||||||
|
captures:
|
||||||
|
1: punctuation.definition.tag.html
|
||||||
|
2: entity.name.tag.style.html
|
||||||
|
3: punctuation.definition.tag.html
|
||||||
|
pop: true
|
||||||
|
- include: tag-stuff
|
||||||
|
- match: (>)
|
||||||
|
captures:
|
||||||
|
1: punctuation.definition.tag.html
|
||||||
|
push:
|
||||||
|
- match: (?=</(?i:style))
|
||||||
|
pop: true
|
||||||
|
- include: embedded-code
|
||||||
|
- include: scope:source.css
|
||||||
|
- match: '(?:^\s+)?(<)((?i:script))\b(?![^>]*/>)'
|
||||||
|
captures:
|
||||||
|
1: punctuation.definition.tag.html
|
||||||
|
2: entity.name.tag.script.html
|
||||||
|
push:
|
||||||
|
- meta_scope: source.js.embedded.html
|
||||||
|
- match: (?<=</(script|SCRIPT))(>)(?:\s*\n)?
|
||||||
|
captures:
|
||||||
|
2: punctuation.definition.tag.html
|
||||||
|
pop: true
|
||||||
|
- include: tag-stuff
|
||||||
|
- match: (?<!</(?:script|SCRIPT))(>)
|
||||||
|
captures:
|
||||||
|
1: punctuation.definition.tag.html
|
||||||
|
2: entity.name.tag.script.html
|
||||||
|
push:
|
||||||
|
- match: (</)((?i:script))
|
||||||
|
captures:
|
||||||
|
1: punctuation.definition.tag.html
|
||||||
|
2: entity.name.tag.script.html
|
||||||
|
pop: true
|
||||||
|
- match: (//).*?((?=</script)|$\n?)
|
||||||
|
scope: comment.line.double-slash.js
|
||||||
|
captures:
|
||||||
|
1: punctuation.definition.comment.js
|
||||||
|
- match: /\*
|
||||||
|
captures:
|
||||||
|
0: punctuation.definition.comment.js
|
||||||
|
push:
|
||||||
|
- meta_scope: comment.block.js
|
||||||
|
- match: \*/|(?=</script)
|
||||||
|
captures:
|
||||||
|
0: punctuation.definition.comment.js
|
||||||
|
pop: true
|
||||||
|
- include: php
|
||||||
|
- include: twig-print-tag
|
||||||
|
- include: twig-statement-tag
|
||||||
|
- include: twig-comment-tag
|
||||||
|
- include: scope:source.js
|
||||||
|
- match: (</?)((?i:body|head|html)\b)
|
||||||
|
captures:
|
||||||
|
1: punctuation.definition.tag.html
|
||||||
|
2: entity.name.tag.structure.any.html
|
||||||
|
push:
|
||||||
|
- meta_scope: meta.tag.structure.any.html
|
||||||
|
- match: (>)
|
||||||
|
captures:
|
||||||
|
1: punctuation.definition.tag.html
|
||||||
|
2: entity.name.tag.structure.any.html
|
||||||
|
pop: true
|
||||||
|
- include: tag-stuff
|
||||||
|
- match: (</?)((?i:address|blockquote|dd|div|dl|dt|fieldset|form|frame|frameset|h1|h2|h3|h4|h5|h6|iframe|noframes|object|ol|p|ul|applet|center|dir|hr|menu|pre)\b)
|
||||||
|
captures:
|
||||||
|
1: punctuation.definition.tag.begin.html
|
||||||
|
2: entity.name.tag.block.any.html
|
||||||
|
push:
|
||||||
|
- meta_scope: meta.tag.block.any.html
|
||||||
|
- match: (>)
|
||||||
|
captures:
|
||||||
|
1: punctuation.definition.tag.end.html
|
||||||
|
pop: true
|
||||||
|
- include: tag-stuff
|
||||||
|
- match: (</?)((?i:a|abbr|acronym|area|b|base|basefont|bdo|big|br|button|caption|cite|code|col|colgroup|del|dfn|em|font|head|html|i|img|input|ins|isindex|kbd|label|legend|li|link|map|meta|noscript|optgroup|option|param|q|s|samp|script|select|small|span|strike|strong|style|sub|sup|table|tbody|td|textarea|tfoot|th|thead|title|tr|tt|u|var)\b)
|
||||||
|
captures:
|
||||||
|
1: punctuation.definition.tag.begin.html
|
||||||
|
2: entity.name.tag.inline.any.html
|
||||||
|
push:
|
||||||
|
- meta_scope: meta.tag.inline.any.html
|
||||||
|
- match: "((?: ?/)?>)"
|
||||||
|
captures:
|
||||||
|
1: punctuation.definition.tag.end.html
|
||||||
|
pop: true
|
||||||
|
- include: tag-stuff
|
||||||
|
- match: "(</?)([a-zA-Z0-9:]+)"
|
||||||
|
captures:
|
||||||
|
1: punctuation.definition.tag.begin.html
|
||||||
|
2: entity.name.tag.other.html
|
||||||
|
push:
|
||||||
|
- meta_scope: meta.tag.other.html
|
||||||
|
- match: (>)
|
||||||
|
captures:
|
||||||
|
1: punctuation.definition.tag.end.html
|
||||||
|
pop: true
|
||||||
|
- include: tag-stuff
|
||||||
|
- include: entities
|
||||||
|
- match: <>
|
||||||
|
scope: invalid.illegal.incomplete.html
|
||||||
|
- match: <
|
||||||
|
scope: invalid.illegal.bad-angle-bracket.html
|
||||||
|
- include: twig-print-tag
|
||||||
|
- include: twig-statement-tag
|
||||||
|
- include: twig-comment-tag
|
||||||
|
embedded-code:
|
||||||
|
- include: ruby
|
||||||
|
- include: php
|
||||||
|
- include: twig-print-tag
|
||||||
|
- include: twig-statement-tag
|
||||||
|
- include: twig-comment-tag
|
||||||
|
- include: python
|
||||||
|
entities:
|
||||||
|
- match: "(&)([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+)(;)"
|
||||||
|
scope: constant.character.entity.html
|
||||||
|
captures:
|
||||||
|
1: punctuation.definition.entity.html
|
||||||
|
3: punctuation.definition.entity.html
|
||||||
|
- match: "&"
|
||||||
|
scope: invalid.illegal.bad-ampersand.html
|
||||||
|
php:
|
||||||
|
- match: (?=(^\s*)?<\?)
|
||||||
|
push:
|
||||||
|
- match: (?!(^\s*)?<\?)
|
||||||
|
pop: true
|
||||||
|
- include: scope:text.html.php
|
||||||
|
python:
|
||||||
|
- match: (?:^\s*)<\?python(?!.*\?>)
|
||||||
|
push:
|
||||||
|
- meta_scope: source.python.embedded.html
|
||||||
|
- match: \?>(?:\s*$\n)?
|
||||||
|
pop: true
|
||||||
|
- include: scope:source.python
|
||||||
|
ruby:
|
||||||
|
- match: "<%+#"
|
||||||
|
captures:
|
||||||
|
0: punctuation.definition.comment.erb
|
||||||
|
push:
|
||||||
|
- meta_scope: comment.block.erb
|
||||||
|
- match: "%>"
|
||||||
|
captures:
|
||||||
|
0: punctuation.definition.comment.erb
|
||||||
|
pop: true
|
||||||
|
- match: <%+(?!>)=?
|
||||||
|
captures:
|
||||||
|
0: punctuation.section.embedded.ruby
|
||||||
|
push:
|
||||||
|
- meta_scope: source.ruby.embedded.html
|
||||||
|
- match: "-?%>"
|
||||||
|
captures:
|
||||||
|
0: punctuation.section.embedded.ruby
|
||||||
|
pop: true
|
||||||
|
- match: (#).*?(?=-?%>)
|
||||||
|
scope: comment.line.number-sign.ruby
|
||||||
|
captures:
|
||||||
|
1: punctuation.definition.comment.ruby
|
||||||
|
- include: scope:source.ruby
|
||||||
|
- match: <\?r(?!>)=?
|
||||||
|
captures:
|
||||||
|
0: punctuation.section.embedded.ruby.nitro
|
||||||
|
push:
|
||||||
|
- meta_scope: source.ruby.nitro.embedded.html
|
||||||
|
- match: '-?\?>'
|
||||||
|
captures:
|
||||||
|
0: punctuation.section.embedded.ruby.nitro
|
||||||
|
pop: true
|
||||||
|
- match: (#).*?(?=-?\?>)
|
||||||
|
scope: comment.line.number-sign.ruby.nitro
|
||||||
|
captures:
|
||||||
|
1: punctuation.definition.comment.ruby.nitro
|
||||||
|
- include: scope:source.ruby
|
||||||
|
string-double-quoted:
|
||||||
|
- match: '"'
|
||||||
|
captures:
|
||||||
|
0: punctuation.definition.string.begin.html
|
||||||
|
push:
|
||||||
|
- meta_scope: string.quoted.double.html
|
||||||
|
- match: '"'
|
||||||
|
captures:
|
||||||
|
0: punctuation.definition.string.end.html
|
||||||
|
pop: true
|
||||||
|
- include: embedded-code
|
||||||
|
- include: entities
|
||||||
|
string-single-quoted:
|
||||||
|
- match: "'"
|
||||||
|
captures:
|
||||||
|
0: punctuation.definition.string.begin.html
|
||||||
|
push:
|
||||||
|
- meta_scope: string.quoted.single.html
|
||||||
|
- match: "'"
|
||||||
|
captures:
|
||||||
|
0: punctuation.definition.string.end.html
|
||||||
|
pop: true
|
||||||
|
- include: embedded-code
|
||||||
|
- include: entities
|
||||||
|
tag-generic-attribute:
|
||||||
|
- match: '\b([a-zA-Z\-:]+)'
|
||||||
|
scope: entity.other.attribute-name.html
|
||||||
|
tag-id-attribute:
|
||||||
|
- match: \b(id)\b\s*(=)
|
||||||
|
captures:
|
||||||
|
1: entity.other.attribute-name.id.html
|
||||||
|
2: punctuation.separator.key-value.html
|
||||||
|
push:
|
||||||
|
- meta_scope: meta.attribute-with-value.id.html
|
||||||
|
- match: (?<='|")
|
||||||
|
captures:
|
||||||
|
1: entity.other.attribute-name.id.html
|
||||||
|
2: punctuation.separator.key-value.html
|
||||||
|
pop: true
|
||||||
|
- match: '"'
|
||||||
|
captures:
|
||||||
|
0: punctuation.definition.string.begin.html
|
||||||
|
push:
|
||||||
|
- meta_scope: string.quoted.double.html
|
||||||
|
- meta_content_scope: meta.toc-list.id.html
|
||||||
|
- match: '"'
|
||||||
|
captures:
|
||||||
|
0: punctuation.definition.string.end.html
|
||||||
|
pop: true
|
||||||
|
- include: embedded-code
|
||||||
|
- include: entities
|
||||||
|
- match: "'"
|
||||||
|
captures:
|
||||||
|
0: punctuation.definition.string.begin.html
|
||||||
|
push:
|
||||||
|
- meta_scope: string.quoted.single.html
|
||||||
|
- meta_content_scope: meta.toc-list.id.html
|
||||||
|
- match: "'"
|
||||||
|
captures:
|
||||||
|
0: punctuation.definition.string.end.html
|
||||||
|
pop: true
|
||||||
|
- include: embedded-code
|
||||||
|
- include: entities
|
||||||
|
tag-stuff:
|
||||||
|
- include: tag-id-attribute
|
||||||
|
- include: tag-generic-attribute
|
||||||
|
- include: string-double-quoted
|
||||||
|
- include: string-single-quoted
|
||||||
|
- include: embedded-code
|
||||||
|
twig-arrays:
|
||||||
|
- match: '(?<=[\s\(\{\[:,])\['
|
||||||
|
captures:
|
||||||
|
0: punctuation.section.array.begin.twig
|
||||||
|
push:
|
||||||
|
- meta_scope: meta.array.twig
|
||||||
|
- match: '\]'
|
||||||
|
captures:
|
||||||
|
0: punctuation.section.array.end.twig
|
||||||
|
pop: true
|
||||||
|
- include: twig-arrays
|
||||||
|
- include: twig-hashes
|
||||||
|
- include: twig-constants
|
||||||
|
- include: twig-strings
|
||||||
|
- include: twig-functions-warg
|
||||||
|
- include: twig-functions
|
||||||
|
- include: twig-macros
|
||||||
|
- include: twig-objects
|
||||||
|
- include: twig-properties
|
||||||
|
- include: twig-filters-warg
|
||||||
|
- include: twig-filters
|
||||||
|
- include: twig-filters-warg-ud
|
||||||
|
- include: twig-filters-ud
|
||||||
|
- match: ","
|
||||||
|
scope: punctuation.separator.object.twig
|
||||||
|
twig-comment-tag:
|
||||||
|
- match: '\{#-?'
|
||||||
|
captures:
|
||||||
|
0: punctuation.definition.comment.begin.twig
|
||||||
|
push:
|
||||||
|
- meta_scope: comment.block.twig
|
||||||
|
- match: '-?#\}'
|
||||||
|
captures:
|
||||||
|
0: punctuation.definition.comment.end.twig
|
||||||
|
pop: true
|
||||||
|
twig-constants:
|
||||||
|
- match: '(?i)(?<=[\s\[\(\{:,])(?:true|false|null|none)(?=[\s\)\]\}\,])'
|
||||||
|
scope: constant.language.twig
|
||||||
|
- match: '(?<=[\s\[\(\{:,]|\.\.|\*\*)[0-9]+(?:\.[0-9]+)?(?=[\s\)\]\}\,]|\.\.|\*\*)'
|
||||||
|
scope: constant.numeric.twig
|
||||||
|
twig-filters:
|
||||||
|
- match: '(?<=(?:[a-zA-Z0-9_\x{7f}-\x{ff}\]\)\''\"]\|)|\{%\sfilter\s)(abs|capitalize|e(?:scape)?|first|join|(?:json|url)_encode|keys|last|length|lower|nl2br|number_format|raw|reverse|round|sort|striptags|title|trim|upper)(?=[\s\|\]\}\):,]|\.\.|\*\*)'
|
||||||
|
captures:
|
||||||
|
1: support.function.twig
|
||||||
|
twig-filters-ud:
|
||||||
|
- match: '(?<=(?:[a-zA-Z0-9_\x{7f}-\x{ff}\]\)\''\"]\|)|\{%\sfilter\s)([a-zA-Z_\x{7f}-\x{ff}][a-zA-Z0-9_\x{7f}-\x{ff}]*)'
|
||||||
|
captures:
|
||||||
|
1: meta.function-call.other.twig
|
||||||
|
twig-filters-warg:
|
||||||
|
- match: '(?<=(?:[a-zA-Z0-9_\x{7f}-\x{ff}\]\)\''\"]\|)|\{%\sfilter\s)(batch|convert_encoding|date|date_modify|default|e(?:scape)?|format|join|merge|number_format|replace|round|slice|split|trim)(\()'
|
||||||
|
captures:
|
||||||
|
1: support.function.twig
|
||||||
|
2: punctuation.definition.parameters.begin.twig
|
||||||
|
push:
|
||||||
|
- meta_content_scope: meta.function.arguments.twig
|
||||||
|
- match: \)
|
||||||
|
captures:
|
||||||
|
0: punctuation.definition.parameters.end.twig
|
||||||
|
pop: true
|
||||||
|
- include: twig-constants
|
||||||
|
- include: twig-functions-warg
|
||||||
|
- include: twig-functions
|
||||||
|
- include: twig-macros
|
||||||
|
- include: twig-objects
|
||||||
|
- include: twig-properties
|
||||||
|
- include: twig-filters-warg
|
||||||
|
- include: twig-filters
|
||||||
|
- include: twig-filters-warg-ud
|
||||||
|
- include: twig-filters-ud
|
||||||
|
- include: twig-strings
|
||||||
|
- include: twig-arrays
|
||||||
|
- include: twig-hashes
|
||||||
|
twig-filters-warg-ud:
|
||||||
|
- match: '(?<=(?:[a-zA-Z0-9_\x{7f}-\x{ff}\]\)\''\"]\|)|\{%\sfilter\s)([a-zA-Z_\x{7f}-\x{ff}][a-zA-Z0-9_\x{7f}-\x{ff}]*)(\()'
|
||||||
|
captures:
|
||||||
|
1: meta.function-call.other.twig
|
||||||
|
2: punctuation.definition.parameters.begin.twig
|
||||||
|
push:
|
||||||
|
- meta_content_scope: meta.function.arguments.twig
|
||||||
|
- match: \)
|
||||||
|
captures:
|
||||||
|
0: punctuation.definition.parameters.end.twig
|
||||||
|
pop: true
|
||||||
|
- include: twig-constants
|
||||||
|
- include: twig-functions-warg
|
||||||
|
- include: twig-functions
|
||||||
|
- include: twig-macros
|
||||||
|
- include: twig-objects
|
||||||
|
- include: twig-properties
|
||||||
|
- include: twig-filters-warg
|
||||||
|
- include: twig-filters
|
||||||
|
- include: twig-filters-warg-ud
|
||||||
|
- include: twig-filters-ud
|
||||||
|
- include: twig-strings
|
||||||
|
- include: twig-arrays
|
||||||
|
- include: twig-hashes
|
||||||
|
twig-functions:
|
||||||
|
- match: (?<=is\s)(defined|empty|even|iterable|odd)
|
||||||
|
captures:
|
||||||
|
1: support.function.twig
|
||||||
|
twig-functions-warg:
|
||||||
|
- match: '(?<=[\s\(\[\{:,])(attribute|block|constant|cycle|date|divisible by|dump|include|max|min|parent|random|range|same as|source|template_from_string)(\()'
|
||||||
|
captures:
|
||||||
|
1: support.function.twig
|
||||||
|
2: punctuation.definition.parameters.begin.twig
|
||||||
|
push:
|
||||||
|
- meta_content_scope: meta.function.arguments.twig
|
||||||
|
- match: \)
|
||||||
|
captures:
|
||||||
|
0: punctuation.definition.parameters.end.twig
|
||||||
|
pop: true
|
||||||
|
- include: twig-constants
|
||||||
|
- include: twig-functions-warg
|
||||||
|
- include: twig-functions
|
||||||
|
- include: twig-macros
|
||||||
|
- include: twig-objects
|
||||||
|
- include: twig-properties
|
||||||
|
- include: twig-filters-warg
|
||||||
|
- include: twig-filters
|
||||||
|
- include: twig-filters-warg-ud
|
||||||
|
- include: twig-filters-ud
|
||||||
|
- include: twig-strings
|
||||||
|
- include: twig-arrays
|
||||||
|
twig-hashes:
|
||||||
|
- match: '(?<=[\s\(\{\[:,])\{'
|
||||||
|
captures:
|
||||||
|
0: punctuation.section.hash.begin.twig
|
||||||
|
push:
|
||||||
|
- meta_scope: meta.hash.twig
|
||||||
|
- match: '\}'
|
||||||
|
captures:
|
||||||
|
0: punctuation.section.hash.end.twig
|
||||||
|
pop: true
|
||||||
|
- include: twig-hashes
|
||||||
|
- include: twig-arrays
|
||||||
|
- include: twig-constants
|
||||||
|
- include: twig-strings
|
||||||
|
- include: twig-functions-warg
|
||||||
|
- include: twig-functions
|
||||||
|
- include: twig-macros
|
||||||
|
- include: twig-objects
|
||||||
|
- include: twig-properties
|
||||||
|
- include: twig-filters-warg
|
||||||
|
- include: twig-filters
|
||||||
|
- include: twig-filters-warg-ud
|
||||||
|
- include: twig-filters-ud
|
||||||
|
- match: ":"
|
||||||
|
scope: punctuation.separator.key-value.twig
|
||||||
|
- match: ","
|
||||||
|
scope: punctuation.separator.object.twig
|
||||||
|
twig-keywords:
|
||||||
|
- match: (?<=\s)((?:end)?(?:autoescape|block|embed|filter|for|if|macro|raw|sandbox|set|spaceless|trans|verbatim)|as|do|else|elseif|extends|flush|from|ignore missing|import|include|only|use|with)(?=\s)
|
||||||
|
scope: keyword.control.twig
|
||||||
|
twig-macros:
|
||||||
|
- match: |-
|
||||||
|
(?x)
|
||||||
|
(?<=[\s\(\[\{:,])
|
||||||
|
([a-zA-Z_\x{7f}-\x{ff}][a-zA-Z0-9_\x{7f}-\x{ff}]*)
|
||||||
|
(?:
|
||||||
|
(\.)([a-zA-Z_\x{7f}-\x{ff}][a-zA-Z0-9_\x{7f}-\x{ff}]*)
|
||||||
|
)?
|
||||||
|
(\()
|
||||||
|
captures:
|
||||||
|
1: meta.function-call.twig
|
||||||
|
2: punctuation.separator.property.twig
|
||||||
|
3: variable.other.property.twig
|
||||||
|
4: punctuation.definition.parameters.begin.twig
|
||||||
|
push:
|
||||||
|
- meta_content_scope: meta.function.arguments.twig
|
||||||
|
- match: \)
|
||||||
|
captures:
|
||||||
|
0: punctuation.definition.parameters.end.twig
|
||||||
|
pop: true
|
||||||
|
- include: twig-constants
|
||||||
|
- include: twig-operators
|
||||||
|
- include: twig-functions-warg
|
||||||
|
- include: twig-functions
|
||||||
|
- include: twig-macros
|
||||||
|
- include: twig-objects
|
||||||
|
- include: twig-properties
|
||||||
|
- include: twig-filters-warg
|
||||||
|
- include: twig-filters
|
||||||
|
- include: twig-filters-warg-ud
|
||||||
|
- include: twig-filters-ud
|
||||||
|
- include: twig-strings
|
||||||
|
- include: twig-arrays
|
||||||
|
- include: twig-hashes
|
||||||
|
twig-objects:
|
||||||
|
- match: '(?<=[\s\{\[\(:,])([a-zA-Z_\x{7f}-\x{ff}][a-zA-Z0-9_\x{7f}-\x{ff}]*)(?=[\s\}\[\]\(\)\.\|,:])'
|
||||||
|
captures:
|
||||||
|
1: variable.other.twig
|
||||||
|
twig-operators:
|
||||||
|
- match: (?<=\s)(\+|-|//?|%|\*\*?)(?=\s)
|
||||||
|
captures:
|
||||||
|
1: keyword.operator.arithmetic.twig
|
||||||
|
- match: (?<=\s)(=|~)(?=\s)
|
||||||
|
captures:
|
||||||
|
1: keyword.operator.assignment.twig
|
||||||
|
- match: (?<=\s)(b-(?:and|or|xor))(?=\s)
|
||||||
|
captures:
|
||||||
|
1: keyword.operator.bitwise.twig
|
||||||
|
- match: '(?<=\s)((?:!|=)=|<=?|>=?|(?:not )?in|is(?: not)?|(?:ends|starts) with|matches)(?=\s)'
|
||||||
|
captures:
|
||||||
|
1: keyword.operator.comparison.twig
|
||||||
|
- match: (?<=\s)(\?|:|and|not|or)(?=\s)
|
||||||
|
captures:
|
||||||
|
1: keyword.operator.logical.twig
|
||||||
|
- match: '(?<=[a-zA-Z0-9_\x{7f}-\x{ff}\]\)''"])\.\.(?=[a-zA-Z0-9_\x{7f}-\x{ff}''"])'
|
||||||
|
captures:
|
||||||
|
0: keyword.operator.other.twig
|
||||||
|
- match: '(?<=[a-zA-Z0-9_\x{7f}-\x{ff}\]\}\)''"])\|(?=[a-zA-Z_\x{7f}-\x{ff}])'
|
||||||
|
captures:
|
||||||
|
0: keyword.operator.other.twig
|
||||||
|
twig-print-tag:
|
||||||
|
- match: '\{\{-?'
|
||||||
|
captures:
|
||||||
|
0: punctuation.section.tag.twig
|
||||||
|
push:
|
||||||
|
- meta_scope: meta.tag.template.value.twig
|
||||||
|
- match: '-?\}\}'
|
||||||
|
captures:
|
||||||
|
0: punctuation.section.tag.twig
|
||||||
|
pop: true
|
||||||
|
- include: twig-constants
|
||||||
|
- include: twig-operators
|
||||||
|
- include: twig-functions-warg
|
||||||
|
- include: twig-functions
|
||||||
|
- include: twig-macros
|
||||||
|
- include: twig-objects
|
||||||
|
- include: twig-properties
|
||||||
|
- include: twig-filters-warg
|
||||||
|
- include: twig-filters
|
||||||
|
- include: twig-filters-warg-ud
|
||||||
|
- include: twig-filters-ud
|
||||||
|
- include: twig-strings
|
||||||
|
- include: twig-arrays
|
||||||
|
- include: twig-hashes
|
||||||
|
twig-properties:
|
||||||
|
- match: |-
|
||||||
|
(?x)
|
||||||
|
(?<=[a-zA-Z0-9_\x{7f}-\x{ff}])
|
||||||
|
(\.)([a-zA-Z_\x{7f}-\x{ff}][a-zA-Z0-9_\x{7f}-\x{ff}]*)
|
||||||
|
(?=[\.\s\|\[\)\]\}:,])
|
||||||
|
captures:
|
||||||
|
1: punctuation.separator.property.twig
|
||||||
|
2: variable.other.property.twig
|
||||||
|
- match: |-
|
||||||
|
(?x)
|
||||||
|
(?<=[a-zA-Z0-9_\x{7f}-\x{ff}])
|
||||||
|
(\.)([a-zA-Z_\x{7f}-\x{ff}][a-zA-Z0-9_\x{7f}-\x{ff}]*)
|
||||||
|
(\()
|
||||||
|
captures:
|
||||||
|
1: punctuation.separator.property.twig
|
||||||
|
2: variable.other.property.twig
|
||||||
|
3: punctuation.definition.parameters.begin.twig
|
||||||
|
push:
|
||||||
|
- meta_content_scope: meta.function.arguments.twig
|
||||||
|
- match: \)
|
||||||
|
captures:
|
||||||
|
0: punctuation.definition.parameters.end.twig
|
||||||
|
pop: true
|
||||||
|
- include: twig-constants
|
||||||
|
- include: twig-functions-warg
|
||||||
|
- include: twig-functions
|
||||||
|
- include: twig-macros
|
||||||
|
- include: twig-objects
|
||||||
|
- include: twig-properties
|
||||||
|
- include: twig-filters-warg
|
||||||
|
- include: twig-filters
|
||||||
|
- include: twig-filters-warg-ud
|
||||||
|
- include: twig-filters-ud
|
||||||
|
- include: twig-strings
|
||||||
|
- include: twig-arrays
|
||||||
|
- match: |-
|
||||||
|
(?x)
|
||||||
|
(?<=[a-zA-Z0-9_\x{7f}-\x{ff}\]])
|
||||||
|
(?:
|
||||||
|
(\[)('[a-zA-Z_\x{7f}-\x{ff}][a-zA-Z0-9_\x{7f}-\x{ff}]*')(\])
|
||||||
|
|(\[)("[a-zA-Z_\x{7f}-\x{ff}][a-zA-Z0-9_\x{7f}-\x{ff}]*")(\])
|
||||||
|
|(\[)([a-zA-Z_\x{7f}-\x{ff}][a-zA-Z0-9_\x{7f}-\x{ff}]*)(\])
|
||||||
|
)
|
||||||
|
captures:
|
||||||
|
1: punctuation.section.array.begin.twig
|
||||||
|
2: variable.other.property.twig
|
||||||
|
3: punctuation.section.array.end.twig
|
||||||
|
4: punctuation.section.array.begin.twig
|
||||||
|
5: variable.other.property.twig
|
||||||
|
6: punctuation.section.array.end.twig
|
||||||
|
7: punctuation.section.array.begin.twig
|
||||||
|
8: variable.other.property.twig
|
||||||
|
9: punctuation.section.array.end.twig
|
||||||
|
twig-statement-tag:
|
||||||
|
- match: '\{%-?'
|
||||||
|
captures:
|
||||||
|
0: punctuation.section.tag.twig
|
||||||
|
push:
|
||||||
|
- meta_scope: meta.tag.template.block.twig
|
||||||
|
- match: '-?%\}'
|
||||||
|
captures:
|
||||||
|
0: punctuation.section.tag.twig
|
||||||
|
pop: true
|
||||||
|
- include: twig-constants
|
||||||
|
- include: twig-keywords
|
||||||
|
- include: twig-operators
|
||||||
|
- include: twig-functions-warg
|
||||||
|
- include: twig-functions
|
||||||
|
- include: twig-macros
|
||||||
|
- include: twig-filters-warg
|
||||||
|
- include: twig-filters
|
||||||
|
- include: twig-filters-warg-ud
|
||||||
|
- include: twig-filters-ud
|
||||||
|
- include: twig-objects
|
||||||
|
- include: twig-properties
|
||||||
|
- include: twig-strings
|
||||||
|
- include: twig-arrays
|
||||||
|
- include: twig-hashes
|
||||||
|
twig-strings:
|
||||||
|
- match: (?:(?<!\\)|(?<=\\\\))'
|
||||||
|
captures:
|
||||||
|
0: punctuation.definition.string.begin.twig
|
||||||
|
push:
|
||||||
|
- meta_scope: string.quoted.single.twig
|
||||||
|
- match: (?:(?<!\\)|(?<=\\\\))'
|
||||||
|
captures:
|
||||||
|
0: punctuation.definition.string.end.twig
|
||||||
|
pop: true
|
||||||
|
- match: (?:(?<!\\)|(?<=\\\\))"
|
||||||
|
captures:
|
||||||
|
0: punctuation.definition.string.begin.twig
|
||||||
|
push:
|
||||||
|
- meta_scope: string.quoted.double.twig
|
||||||
|
- match: (?:(?<!\\)|(?<=\\\\))"
|
||||||
|
captures:
|
||||||
|
0: punctuation.definition.string.end.twig
|
||||||
|
pop: true
|
||||||
Vendored
+1
@@ -12,6 +12,7 @@ file_extensions:
|
|||||||
- lng
|
- lng
|
||||||
- cfg
|
- cfg
|
||||||
- CFG
|
- CFG
|
||||||
|
- desktop
|
||||||
- url
|
- url
|
||||||
- URL
|
- URL
|
||||||
- .editorconfig
|
- .editorconfig
|
||||||
|
|||||||
+1
Submodule assets/syntaxes/Jsonnet added at 80775c616e
Vendored
+1
-1
Submodule assets/syntaxes/Packages updated: 289782ff2e...c1a7427015
+1
Submodule assets/syntaxes/Protobuf added at 5115c1c59a
+1
Submodule assets/syntaxes/Syslog added at 7628d4e0b8
+1
Submodule assets/syntaxes/Terraform added at 3227a2d2a2
+1
Submodule assets/syntaxes/varlink added at 04f30d4b83
@@ -1,26 +1,31 @@
|
|||||||
#[macro_use]
|
// TODO: Re-enable generation of shell completion files (below) when clap 3 is out.
|
||||||
extern crate clap;
|
// For more details, see https://github.com/sharkdp/bat/issues/372
|
||||||
|
|
||||||
use clap::Shell;
|
fn main() {}
|
||||||
use std::fs;
|
|
||||||
|
|
||||||
include!("src/clap_app.rs");
|
// #[macro_use]
|
||||||
|
// extern crate clap;
|
||||||
|
|
||||||
const BIN_NAME: &str = "bat";
|
// use clap::Shell;
|
||||||
|
// use std::fs;
|
||||||
|
|
||||||
fn main() {
|
// include!("src/clap_app.rs");
|
||||||
let outdir = std::env::var_os("SHELL_COMPLETIONS_DIR").or(std::env::var_os("OUT_DIR"));
|
|
||||||
|
|
||||||
let outdir = match outdir {
|
// const BIN_NAME: &str = "bat";
|
||||||
None => return,
|
|
||||||
Some(outdir) => outdir,
|
|
||||||
};
|
|
||||||
|
|
||||||
fs::create_dir_all(&outdir).unwrap();
|
// fn main() {
|
||||||
|
// let outdir = std::env::var_os("SHELL_COMPLETIONS_DIR").or(std::env::var_os("OUT_DIR"));
|
||||||
|
|
||||||
let mut app = build_app(true);
|
// let outdir = match outdir {
|
||||||
app.gen_completions(BIN_NAME, Shell::Bash, &outdir);
|
// None => return,
|
||||||
app.gen_completions(BIN_NAME, Shell::Fish, &outdir);
|
// Some(outdir) => outdir,
|
||||||
app.gen_completions(BIN_NAME, Shell::Zsh, &outdir);
|
// };
|
||||||
app.gen_completions(BIN_NAME, Shell::PowerShell, &outdir);
|
|
||||||
}
|
// fs::create_dir_all(&outdir).unwrap();
|
||||||
|
|
||||||
|
// let mut app = build_app(true);
|
||||||
|
// app.gen_completions(BIN_NAME, Shell::Bash, &outdir);
|
||||||
|
// app.gen_completions(BIN_NAME, Shell::Fish, &outdir);
|
||||||
|
// app.gen_completions(BIN_NAME, Shell::Zsh, &outdir);
|
||||||
|
// app.gen_completions(BIN_NAME, Shell::PowerShell, &outdir);
|
||||||
|
// }
|
||||||
|
|||||||
Vendored
+1
@@ -0,0 +1 @@
|
|||||||
|
* linguist-vendored
|
||||||
@@ -0,0 +1,447 @@
|
|||||||
|
<p align="center">
|
||||||
|
<img src="logo-header.svg" alt="bat - a cat clone with wings"><br>
|
||||||
|
<a href="https://travis-ci.org/sharkdp/bat"><img src="https://travis-ci.org/sharkdp/bat.svg?branch=master" alt="Build Status"></a>
|
||||||
|
<a href="https://ci.appveyor.com/project/sharkdp/bat"><img src="https://ci.appveyor.com/api/projects/status/cptsmtbiwbnr2vhf?svg=true"></a>
|
||||||
|
<img src="https://img.shields.io/crates/l/bat.svg" alt="license">
|
||||||
|
<a href="https://crates.io/crates/bat"><img src="https://img.shields.io/crates/v/bat.svg?colorB=319e8c" alt="Version info"></a><br>
|
||||||
|
A <i>cat(1)</i> clone with syntax highlighting and Git integration.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p align="center">
|
||||||
|
<a href="#syntax-highlighting">特徴</a> •
|
||||||
|
<a href="#how-to-use">使い方</a> •
|
||||||
|
<a href="#installation">インストール</a> •
|
||||||
|
<a href="#customization">カスタマイズ</a> •
|
||||||
|
<a href="#project-goals-and-alternatives">プロジェクトの目標と既存の類似したOSS</a> •
|
||||||
|
翻訳 [<a href="https://github.com/chinanf-boy/bat-zh">中文</a>][<a href="README-ja">日本文</a>]
|
||||||
|
</p>
|
||||||
|
|
||||||
|
### シンタックスハイライト
|
||||||
|
|
||||||
|
`bat` は多くのプログラミング言語やマークアップ言語のシンタックスハイライトに対応しています。
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
### Gitの統合
|
||||||
|
|
||||||
|
|
||||||
|
`bat` は `git` とも連携しており、差分を表現する記号が表示されます(図の左端):
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
### 空白文字の可視化
|
||||||
|
|
||||||
|
`-A`/`--show-all` オプションをつけることで、空白文字を可視化できます:
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
### 自動呼び出し
|
||||||
|
|
||||||
|
出力が1つの画面に対して大きすぎる場合、`bat` は自身の出力を `less` にパイプで繋げることが可能です。
|
||||||
|
|
||||||
|
### ファイルの連結
|
||||||
|
|
||||||
|
あなたはさらにファイルを連結させるに使うことも可能です:wink:。
|
||||||
|
`bat` は非対話型のターミナルを検出すると、いつでも `cat` の完全互換として振る舞い、
|
||||||
|
プレーンなファイルを表示します。
|
||||||
|
|
||||||
|
## 使い方
|
||||||
|
|
||||||
|
単一のファイルを表示させたい
|
||||||
|
|
||||||
|
```bash
|
||||||
|
> bat README.md
|
||||||
|
```
|
||||||
|
|
||||||
|
複数のファイルを一度に表示させたい場合
|
||||||
|
|
||||||
|
```bash
|
||||||
|
> bat src/*.rs
|
||||||
|
```
|
||||||
|
|
||||||
|
標準入力から自動的に構文を決定させたい場合
|
||||||
|
|
||||||
|
```bash
|
||||||
|
> curl -s https://sh.rustup.rs | bat
|
||||||
|
```
|
||||||
|
|
||||||
|
Read from stdin, specify the language explicitly
|
||||||
|
標準入力から明示的に言語を指定したい場合
|
||||||
|
|
||||||
|
```bash
|
||||||
|
> yaml2json .travis.yml | json_pp | bat -l json
|
||||||
|
```
|
||||||
|
|
||||||
|
空白文字を可視化させたい場合:
|
||||||
|
```bash
|
||||||
|
> bat -A /etc/hosts
|
||||||
|
```
|
||||||
|
|
||||||
|
`cat` の代わりに `bat` を使用する際の例:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
bat > note.md # quickly create a new file
|
||||||
|
|
||||||
|
bat header.md content.md footer.md > document.md
|
||||||
|
|
||||||
|
bat -n main.rs # show line numbers (only)
|
||||||
|
|
||||||
|
bat f - g # output 'f', then stdin, then 'g'.
|
||||||
|
```
|
||||||
|
|
||||||
|
## インストール
|
||||||
|
|
||||||
|
### Ubuntu
|
||||||
|
*... や他のDebianベースのLinuxディストリビューション*
|
||||||
|
|
||||||
|
最新の `.deb` パッケージを[こちら](https://github.com/sharkdp/bat/releases)からダウンロードして、インストールしてください:
|
||||||
|
|
||||||
|
``` bash
|
||||||
|
sudo dpkg -i bat_0.10.0_amd64.deb # adapt version number and architecture
|
||||||
|
```
|
||||||
|
|
||||||
|
### Arch Linux
|
||||||
|
|
||||||
|
[Arch Linuxの公式リソース](https://www.archlinux.org/packages/community/x86_64/bat/)からインストールできます。
|
||||||
|
|
||||||
|
```bash
|
||||||
|
pacman -S bat
|
||||||
|
```
|
||||||
|
|
||||||
|
### Void Linux
|
||||||
|
|
||||||
|
xbps-ininstall経由で `bat` をインストールできます。
|
||||||
|
|
||||||
|
```
|
||||||
|
xbps-install -S bat
|
||||||
|
```
|
||||||
|
|
||||||
|
### Fedora
|
||||||
|
|
||||||
|
[Fedora Modular](https://docs.fedoraproject.org/en-US/modularity/using-modules/)経由で `bat` をインストールできます。これはFedora 29以上ではデフォルトで有効化されています。 もしそうでなければ、 `dnf install fedora-repos-modular` を実行してセットアップし、 `fedora-modular` と `fedora-updates-modular` が `/etc/yum.repos.d` で有効化されていることを確認してください。
|
||||||
|
|
||||||
|
```bash
|
||||||
|
dnf module install bat
|
||||||
|
```
|
||||||
|
|
||||||
|
### FreeBSD
|
||||||
|
|
||||||
|
事前にコンパイル済みである[pkg](https://www.freshports.org/textproc/bat)をインストールできます:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
pkg install bat
|
||||||
|
```
|
||||||
|
|
||||||
|
または、FreeBSDのportsから自身でビルドすることも可能です:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd /usr/ports/textproc/bat
|
||||||
|
make install
|
||||||
|
```
|
||||||
|
|
||||||
|
### nix
|
||||||
|
|
||||||
|
`bat` を[nix package manager](https://nixos.org/nix)経由でインストールすることができます:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
nix-env -i bat
|
||||||
|
```
|
||||||
|
|
||||||
|
### openSUSE
|
||||||
|
|
||||||
|
You can install `bat` with zypper:
|
||||||
|
|
||||||
|
`bat` をzypperでインストールすることができます:
|
||||||
|
|
||||||
|
```
|
||||||
|
zypper install bat
|
||||||
|
```
|
||||||
|
|
||||||
|
### macOS
|
||||||
|
|
||||||
|
[Homebrew](http://braumeister.org/formula/bat)でインストールすることができます:
|
||||||
|
|
||||||
|
|
||||||
|
```bash
|
||||||
|
brew install bat
|
||||||
|
```
|
||||||
|
|
||||||
|
### Windows
|
||||||
|
|
||||||
|
You can download prebuilt binaries from the [Release page],
|
||||||
|
or install it with :
|
||||||
|
|
||||||
|
事前にビルド済みのバイナリを[リリースページ](https://github.com/sharkdp/bat/releases)からダウンロードすることができます。または、[scoop](https://scoop.sh/)でインストールすることも可能です。
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scoop install bat
|
||||||
|
```
|
||||||
|
|
||||||
|
[See below](#using-bat-on-windows) for notes.
|
||||||
|
|
||||||
|
### Docker
|
||||||
|
|
||||||
|
|
||||||
|
コンテナ内で`bat` を使いたい方のために[Docker image](https://hub.docker.com/r/danlynn/bat/)が用意されています。
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker pull danlynn/bat
|
||||||
|
alias bat='docker run -it --rm -e BAT_THEME -e BAT_STYLE -e BAT_TABS -v "$(pwd):/myapp" danlynn/bat'
|
||||||
|
```
|
||||||
|
|
||||||
|
### Ansible
|
||||||
|
|
||||||
|
[Ansible](https://www.ansible.com/)でインストールすることができます:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Install role on local machine
|
||||||
|
ansible-galaxy install aeimer.install_bat
|
||||||
|
```
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
# Playbook to install bat
|
||||||
|
- host: all
|
||||||
|
roles:
|
||||||
|
- aeimer.install_bat
|
||||||
|
```
|
||||||
|
|
||||||
|
- [Ansible Galaxy](https://galaxy.ansible.com/aeimer/install_bat)
|
||||||
|
- [GitHub](https://github.com/aeimer/ansible-install-bat)
|
||||||
|
|
||||||
|
これは以下のディストリビューションで動作するはずです:
|
||||||
|
- Debian/Ubuntu
|
||||||
|
- ARM (eg. Raspberry PI)
|
||||||
|
- Arch Linux
|
||||||
|
- Void Linux
|
||||||
|
- FreeBSD
|
||||||
|
- MacOS
|
||||||
|
|
||||||
|
### From binaries
|
||||||
|
|
||||||
|
|
||||||
|
多くの異なるアーキテクチャのためのプレビルドバージョンを[リリースページ](https://github.com/sharkdp/bat/releases)からチェックしてみてください。静的にリンクされている多くのバイナリも利用できます: ファイル名に `musl` を含むアーカイブを探します。
|
||||||
|
|
||||||
|
### From source
|
||||||
|
|
||||||
|
|
||||||
|
`bat` をソースからビルドしたいならば、Rust 1.29 以上の環境が必要です。そして、 `cargo` をビルドに対して使用します:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cargo install bat
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
`cmake` と `libz` 開発パッケージ(`libz-dev` または `libz-devel`)が正しくビルドをするためにインストールする必要があるかもしれません。
|
||||||
|
|
||||||
|
## カスタマイズ
|
||||||
|
|
||||||
|
### ハイライト テーマ
|
||||||
|
|
||||||
|
`bat --list-themes` を使うと現在利用可能なシンタックスハイライトのテーマを入手できます。 `TwoDark` テーマを選ぶためには `--theme=TwoDark` オプションをつけるか `BAT_THEME` という環境変数に `TwoDark` を代入する必要があります。 シェルの起動ファイルに `export BAT_THEME="TwoDark"` と定義すればその設定が変わることはないでしょう。あるいは、 `bat` の[設定ファイル](https://github.com/sharkdp/bat#configuration-file)を利用してください。
|
||||||
|
|
||||||
|
|
||||||
|
もし、ファイルにより異なるテーマを利用したい場合は、以下の[`fzf`](https://github.com/junegunn/fzf)を利用した以下のコマンドを使うことができます:
|
||||||
|
``` bash
|
||||||
|
bat --list-themes | fzf --preview="bat --theme={} --color=always /path/to/file"
|
||||||
|
```
|
||||||
|
|
||||||
|
`bat` はデフォルトだと黒い背景色のターミナルに適しています。しかし、`GitHub` や `OneHalfLight` のような白い背景色のテーマでもいい感じにすることができます。
|
||||||
|
以下のカスタムテーマを参考にしてみてください。
|
||||||
|
['Adding new themes' section below](https://github.com/sharkdp/bat#adding-new-themes)
|
||||||
|
|
||||||
|
### 出力のスタイル
|
||||||
|
|
||||||
|
`--style` を使うことで `bat` の表示の見た目を変更することができます。例えば、 `--style=numbers,changes` と入力します。すると、Gitの差分と行番号だけが表示され、グリッド線とファイルヘッダーは表示されません。
|
||||||
|
環境変数に `BAT_STYLE` を定義するとこれらの設定を永続的に使用することができます。
|
||||||
|
[設定ファイル](https://github.com/sharkdp/bat#configuration-file)を参考にしても良いでしょう。
|
||||||
|
|
||||||
|
### 新しい構文の追加 / 言語の定義
|
||||||
|
|
||||||
|
`bat` はシンタックスハイライトのための[`syntext`](https://github.com/trishume/syntect/)という最高にイケてるライブラリを使用しています。`syntect` はSublime Textのために作られた[`.sublime-syntax` file](https://www.sublimetext.com/docs/3/syntax.html)テーマです。新しい構文を定義するために以下の手順を行います。
|
||||||
|
|
||||||
|
構文定義ファイルを入れておくためのフォルダを作る:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
mkdir -p "$(bat --config-dir)/syntaxes"
|
||||||
|
cd "$(bat --config-dir)/syntaxes"
|
||||||
|
|
||||||
|
# Put new '.sublime-syntax' language definition files
|
||||||
|
# in this folder (or its subdirectories), for example:
|
||||||
|
git clone https://github.com/tellnobody1/sublime-purescript-syntax
|
||||||
|
```
|
||||||
|
|
||||||
|
次のコマンドを使用して、これらのファイルをバイナリキャッシュに解析します:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
bat cache --build
|
||||||
|
```
|
||||||
|
|
||||||
|
最後に `bat --list-languages` と入力すると新しい言語が利用可能かどうかチェックします。
|
||||||
|
デフォルトの設定に戻したいときは以下のコマンドを実行します:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
bat cache --clear
|
||||||
|
```
|
||||||
|
|
||||||
|
### 新しいテーマの追加
|
||||||
|
|
||||||
|
これは構文を新しく定義するやり方と非常に似ています。
|
||||||
|
|
||||||
|
まず、新しいシンタックスハイライトのテーマのフォルダを作ります:
|
||||||
|
```bash
|
||||||
|
mkdir -p "$(bat --config-dir)/themes"
|
||||||
|
cd "$(bat --config-dir)/themes"
|
||||||
|
|
||||||
|
# Download a theme in '.tmTheme' format, for example:
|
||||||
|
git clone https://github.com/greggb/sublime-snazzy
|
||||||
|
|
||||||
|
# Update the binary cache
|
||||||
|
bat cache --build
|
||||||
|
```
|
||||||
|
|
||||||
|
最後に、 `bat --list-themes` で新しいテーマが利用可能がチェックします
|
||||||
|
|
||||||
|
### 異なるページャーの使用
|
||||||
|
|
||||||
|
`bat` は環境変数 `PAGER` に使用するページャーを明記します。
|
||||||
|
この環境変数が定義されていない場合、デフォルトで `less` が使用されます。もし、異なるページャーが使用したい場合は、`PAGER` を修正してください。または、`PAGER` を上書きする環境変数として `BAT_PAGER` を定義することも可能です。
|
||||||
|
|
||||||
|
もし、ページャーにコマンドライン引数を渡したい場合は、 `PAGER`/`BAT_PAGER` 環境変数を定義してください:
|
||||||
|
```bash
|
||||||
|
export BAT_PAGER="less -RF"
|
||||||
|
```
|
||||||
|
|
||||||
|
環境変数を利用する代わりに、 `bat` の[設定ファイル](https://github.com/sharkdp/bat#configuration-file)の `--pager` オプションを使用することも可能です。
|
||||||
|
|
||||||
|
**注意**: デフォルトにより、ページャーが `less` にセットされているならば `bat` は以下のコマンドラインを受け付けるでしょう。
|
||||||
|
ページャーのオプション: `-R`/`--RAW-CONTROL-CHARS`, `-F`/`--quit-if-one-screen` , `-X`/`--no-init`
|
||||||
|
最初の `-R` はANSIカラーを正しく解釈するために必要です。2番目の `-F` は出力サイズがターミナルの縦のサイズよりも小さいならば `less` に即座に終了するように命令します。したがって、少量のファイルのためにページャーを終了する `q` を押す必要がありません。3番目のオプションの `-X` は `less` の古いバージョンの機能である `--quit-if-one-screen` でバグを修正するために必要です。運の悪いことに、これは `less` のマウス-ホイールのサポートを無効にします。もし、マウス-ホイール スクローリングを有効にしたいなら、`-R` だけをオプションとしてつけてください(ただし、これは `--quit-if-one-screen` を無効にするでしょう)。または、 `less` の最近バージョンを利用し、 `-RF` をつけてください。 これは望ましいことに `--quit-if-one-screen` と マウス-ホイールスクローリングの両方を有効にするでしょう。
|
||||||
|
|
||||||
|
スクロールが未だ動作しないのであれば、加えて `-S` オプションを追加してみてください。
|
||||||
|
|
||||||
|
## 設定ファイル
|
||||||
|
|
||||||
|
|
||||||
|
`bat` は設定ファイルでカスタマイズすることが可能です。ファイルの場所はOSに依存します。使用しているOSのデフォルトパスを調べるには以下のコマンドを実行してください:
|
||||||
|
```
|
||||||
|
bat --config-file
|
||||||
|
```
|
||||||
|
|
||||||
|
また、環境変数 `BAT_CONFIG_PATH` に設定ファイルの場所を明記することもできます:
|
||||||
|
```bash
|
||||||
|
export BAT_CONFIG_PATH="/path/to/bat.conf"
|
||||||
|
```
|
||||||
|
|
||||||
|
### フォーマット
|
||||||
|
|
||||||
|
|
||||||
|
この設定ファイルはコマンドライン引数の単純なリストです。 `bat --help` を利用すると、利用可能なオプションとその値を閲覧することができます。さらに、`#` でコメント文を加えることができます。
|
||||||
|
|
||||||
|
設定ファイルの例:
|
||||||
|
```bash
|
||||||
|
# Set the theme to "TwoDark"
|
||||||
|
--theme="TwoDark"
|
||||||
|
|
||||||
|
# Show line numbers, Git modifications and file header (but no grid)
|
||||||
|
--style="numbers,changes,header"
|
||||||
|
|
||||||
|
# Use italic text on the terminal (not supported on all terminals)
|
||||||
|
--italic-text=always
|
||||||
|
|
||||||
|
# Add mouse scrolling support in less (does not work with older
|
||||||
|
# versions of "less")
|
||||||
|
--pager="less -FR"
|
||||||
|
|
||||||
|
# Use C++ syntax (instead of C) for .h header files
|
||||||
|
--map-syntax h:cpp
|
||||||
|
|
||||||
|
# Use "gitignore" highlighting for ".ignore" files
|
||||||
|
--map-syntax .ignore:.gitignore
|
||||||
|
```
|
||||||
|
|
||||||
|
## Windows での `bat` の利用
|
||||||
|
|
||||||
|
Windows 上で `bat` はほとんど動作しますが、いくつかの機能は設定を必要をする場合があります。
|
||||||
|
|
||||||
|
### ページング
|
||||||
|
|
||||||
|
Windows only includes a very limited pager in the form of `more`. You can download a Windows binary
|
||||||
|
for `less` [from its homepage](http://www.greenwoodsoftware.com/less/download.html) or [through
|
||||||
|
Chocolatey](https://chocolatey.org/packages/Less). To use it, place the binary in a directory in
|
||||||
|
your `PATH` or [define an environment variable](#using-a-different-pager).
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### 色
|
||||||
|
|
||||||
|
Windows 10 は[v1151](https://en.wikipedia.org/wiki/Windows_10_version_history#Version_1511_(November_Update))からbashの新しいバージョンと同様に `conhost.exe`(コマンドプロンプト)と PowerShell の色をネイティブサポートしていません。Windows の新しいバージョンでは、[Cmder](http://cmder.net/)を使うことができます。これは[ConEmu](https://conemu.github.io/)を含んでいます。
|
||||||
|
|
||||||
|
**注意:** Git と MSYS の `less` はWindows上で色を正しく解釈しません。もし、あなたが他のページャーをインストールしていないのであれば、 `--paging=never` オプションを付け加えるまたは `BAT_PAGER` に空文字を設定することでページングを完全に無効にできます。
|
||||||
|
|
||||||
|
### Cygwin
|
||||||
|
|
||||||
|
Windows上の `bat` は Cygwin のunix風のpath(`/cygdrive/*`)をネイティブサポートしていません。
|
||||||
|
絶対的なcygwinパスを引数として受けたときに、 `bat` は以下のエラーを返すでしょう: `The system cannot find the path specified. (os error 3)`
|
||||||
|
|
||||||
|
wrapperを作成するまたは以下の関数を `.bash_profile` に追記することでこの問題を解決することができます:
|
||||||
|
```shell
|
||||||
|
bat() {
|
||||||
|
local index
|
||||||
|
local args=("$@")
|
||||||
|
for index in $(seq 0 ${#args[@]}) ; do
|
||||||
|
case "${args[index]}" in
|
||||||
|
-*) continue;;
|
||||||
|
*) [ -e "${args[index]}" ] && args[index]="$(cygpath --windows "${args[index]}")";;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
command bat "${args[@]}"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## トラブルシューティング
|
||||||
|
|
||||||
|
### ターミナルと色
|
||||||
|
|
||||||
|
`bat` はターミナルがトゥルーカラーをサポートしている/していない関係なくサポートします。しかし、シンタックスハイライトのテーマの色が8-bitカラーに最適化されていない場合、24-bitであるトゥルーカラーをサポートしているターミナルを使用することを強く推奨します(`terminator`, `konsole`, `iTerm2`, ...)。
|
||||||
|
この[記事](https://gist.github.com/XVilka/8346728)には24-bitカラーがサポートされているターミナルの一覧が掲載されています。
|
||||||
|
|
||||||
|
本当の色をターミナルにセットするために、環境変数 `COLORTERM` に `truecolor` か `24bit` のどちらかを代入してください。さもなければ、 `bat` はどの色を使うのか決定することができません。または、24-bit エスケープシーケンスがサポートされません(そして、8-bit colorに戻ります)。
|
||||||
|
|
||||||
|
### 行番号とグリッド線がほとんど見えない
|
||||||
|
|
||||||
|
異なるテーマを試してみてください(`bat --list-themes` でテーマを閲覧できます)。 `OneHalfDark` と `OneHalfLight` テーマはグリッド線と線の色を明るくします。
|
||||||
|
|
||||||
|
|
||||||
|
## 開発
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Recursive clone to retrieve all submodules
|
||||||
|
git clone --recursive https://github.com/sharkdp/bat
|
||||||
|
|
||||||
|
# Build (debug version)
|
||||||
|
cd bat
|
||||||
|
cargo build
|
||||||
|
|
||||||
|
# Run unit tests and integration tests
|
||||||
|
cargo test
|
||||||
|
|
||||||
|
# Install (release version)
|
||||||
|
cargo install
|
||||||
|
|
||||||
|
# Build a bat binary with modified syntaxes and themes
|
||||||
|
bash assets/create.sh
|
||||||
|
cargo install -f
|
||||||
|
```
|
||||||
|
|
||||||
|
## プロジェクトの目標と既存の類似したOSS
|
||||||
|
|
||||||
|
`bat` は以下の目標を達成しようと試みています:
|
||||||
|
|
||||||
|
- 美しい高度なシンタックスハイライトの提供
|
||||||
|
- ファイルの差分を表示するためのGitとの連携
|
||||||
|
- (POSIX) `cat` との完全互換
|
||||||
|
- ユーザーフレンドリーがコマンドラインインターフェースの提供
|
||||||
|
|
||||||
|
既存の類似したOSSはたくさんあります。
|
||||||
|
`bat` とこれらを比較した表が[こちら](alternatives.md)にあります。
|
||||||
@@ -21,3 +21,4 @@ request.
|
|||||||
|
|
||||||
Some other alternatives that are also related, but not yet included in the table:
|
Some other alternatives that are also related, but not yet included in the table:
|
||||||
- [lesspipe](https://github.com/wofr06/lesspipe)
|
- [lesspipe](https://github.com/wofr06/lesspipe)
|
||||||
|
- [vimpager](https://github.com/rkitover/vimpager)
|
||||||
|
|||||||
+10
-1
@@ -77,7 +77,11 @@ pub struct Config<'a> {
|
|||||||
/// Command to start the pager
|
/// Command to start the pager
|
||||||
pub pager: Option<&'a str>,
|
pub pager: Option<&'a str>,
|
||||||
|
|
||||||
|
/// Whether or not to use ANSI italics
|
||||||
pub use_italic_text: bool,
|
pub use_italic_text: bool,
|
||||||
|
|
||||||
|
/// Lines to highlight
|
||||||
|
pub highlight_lines: Vec<usize>,
|
||||||
}
|
}
|
||||||
|
|
||||||
fn is_truecolor_terminal() -> bool {
|
fn is_truecolor_terminal() -> bool {
|
||||||
@@ -168,7 +172,7 @@ impl App {
|
|||||||
return Err("Invalid syntax mapping. The format of the -m/--map-syntax option is 'from:to'.".into());
|
return Err("Invalid syntax mapping. The format of the -m/--map-syntax option is 'from:to'.".into());
|
||||||
}
|
}
|
||||||
|
|
||||||
syntax_mapping.insert(parts[0].into(), parts[1].into());
|
syntax_mapping.insert(parts[0], parts[1]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -264,6 +268,11 @@ impl App {
|
|||||||
Some("always") => true,
|
Some("always") => true,
|
||||||
_ => false,
|
_ => false,
|
||||||
},
|
},
|
||||||
|
highlight_lines: self
|
||||||
|
.matches
|
||||||
|
.values_of("highlight-line")
|
||||||
|
.and_then(|ws| ws.map(|w| w.parse().ok()).collect())
|
||||||
|
.unwrap_or_default(),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -216,6 +216,10 @@ pub fn config_dir() -> Cow<'static, str> {
|
|||||||
PROJECT_DIRS.config_dir().to_string_lossy()
|
PROJECT_DIRS.config_dir().to_string_lossy()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn cache_dir() -> Cow<'static, str> {
|
||||||
|
PROJECT_DIRS.cache_dir().to_string_lossy()
|
||||||
|
}
|
||||||
|
|
||||||
pub fn clear_assets() {
|
pub fn clear_assets() {
|
||||||
print!("Clearing theme set cache ... ");
|
print!("Clearing theme set cache ... ");
|
||||||
fs::remove_file(theme_set_path()).ok();
|
fs::remove_file(theme_set_path()).ok();
|
||||||
|
|||||||
+36
-16
@@ -175,6 +175,7 @@ pub fn build_app(interactive_output: bool) -> ClapApp<'static, 'static> {
|
|||||||
.arg(
|
.arg(
|
||||||
Arg::with_name("line-range")
|
Arg::with_name("line-range")
|
||||||
.long("line-range")
|
.long("line-range")
|
||||||
|
.short("r")
|
||||||
.multiple(true)
|
.multiple(true)
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.number_of_values(1)
|
.number_of_values(1)
|
||||||
@@ -188,6 +189,19 @@ pub fn build_app(interactive_output: bool) -> ClapApp<'static, 'static> {
|
|||||||
'--line-range 40:' prints lines 40 to the end of the file",
|
'--line-range 40:' prints lines 40 to the end of the file",
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
.arg(
|
||||||
|
Arg::with_name("highlight-line")
|
||||||
|
.long("highlight-line")
|
||||||
|
.short("H")
|
||||||
|
.takes_value(true)
|
||||||
|
.number_of_values(1)
|
||||||
|
.multiple(true)
|
||||||
|
.value_name("N")
|
||||||
|
.help("Highlight the given line.")
|
||||||
|
.long_help(
|
||||||
|
"Highlight the N-th line with a different background color",
|
||||||
|
),
|
||||||
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::with_name("color")
|
Arg::with_name("color")
|
||||||
.long("color")
|
.long("color")
|
||||||
@@ -335,17 +349,29 @@ pub fn build_app(interactive_output: bool) -> ClapApp<'static, 'static> {
|
|||||||
.hidden(true)
|
.hidden(true)
|
||||||
.help("Show path to the configuration file."),
|
.help("Show path to the configuration file."),
|
||||||
)
|
)
|
||||||
|
.arg(
|
||||||
|
Arg::with_name("config-dir")
|
||||||
|
.long("config-dir")
|
||||||
|
.hidden(true)
|
||||||
|
.help("Show bat's configuration directory."),
|
||||||
|
)
|
||||||
|
.arg(
|
||||||
|
Arg::with_name("cache-dir")
|
||||||
|
.long("cache-dir")
|
||||||
|
.hidden(true)
|
||||||
|
.help("Show bat's cache directory."),
|
||||||
|
)
|
||||||
.subcommand(
|
.subcommand(
|
||||||
SubCommand::with_name("cache")
|
SubCommand::with_name("cache")
|
||||||
.about("Modify the syntax-definition and theme cache")
|
.about("Modify the syntax-definition and theme cache")
|
||||||
.arg(
|
.arg(
|
||||||
Arg::with_name("init")
|
Arg::with_name("build")
|
||||||
.long("init")
|
.long("build")
|
||||||
.short("i")
|
.short("b")
|
||||||
.help("Initialize the syntax/theme cache.")
|
.help("Initialize (or update) the syntax/theme cache.")
|
||||||
.long_help(
|
.long_help(
|
||||||
"Initialize the syntax/theme cache by loading from the \
|
"Initialize (or update) the syntax/theme cache by loading from \
|
||||||
source directory (default: the configuration directory).",
|
the source directory (default: the configuration directory).",
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
@@ -354,21 +380,15 @@ pub fn build_app(interactive_output: bool) -> ClapApp<'static, 'static> {
|
|||||||
.short("c")
|
.short("c")
|
||||||
.help("Remove the cached syntax definitions and themes."),
|
.help("Remove the cached syntax definitions and themes."),
|
||||||
)
|
)
|
||||||
.arg(
|
|
||||||
Arg::with_name("config-dir")
|
|
||||||
.long("config-dir")
|
|
||||||
.short("d")
|
|
||||||
.help("Show bat's configuration directory."),
|
|
||||||
)
|
|
||||||
.group(
|
.group(
|
||||||
ArgGroup::with_name("cache-actions")
|
ArgGroup::with_name("cache-actions")
|
||||||
.args(&["init", "clear", "config-dir"])
|
.args(&["build", "clear"])
|
||||||
.required(arg_group_required),
|
.required(arg_group_required),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::with_name("source")
|
Arg::with_name("source")
|
||||||
.long("source")
|
.long("source")
|
||||||
.requires("init")
|
.requires("build")
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.value_name("dir")
|
.value_name("dir")
|
||||||
.help("Use a different directory to load syntaxes and themes from."),
|
.help("Use a different directory to load syntaxes and themes from."),
|
||||||
@@ -376,14 +396,14 @@ pub fn build_app(interactive_output: bool) -> ClapApp<'static, 'static> {
|
|||||||
.arg(
|
.arg(
|
||||||
Arg::with_name("target")
|
Arg::with_name("target")
|
||||||
.long("target")
|
.long("target")
|
||||||
.requires("init")
|
.requires("build")
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.value_name("dir")
|
.value_name("dir")
|
||||||
.help(
|
.help(
|
||||||
"Use a different directory to store the cached syntax and theme set.",
|
"Use a different directory to store the cached syntax and theme set.",
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
.arg(Arg::with_name("blank").long("blank").requires("init").help(
|
.arg(Arg::with_name("blank").long("blank").requires("build").help(
|
||||||
"Create completely new syntax and theme sets \
|
"Create completely new syntax and theme sets \
|
||||||
(instead of appending to the default sets).",
|
(instead of appending to the default sets).",
|
||||||
)),
|
)),
|
||||||
|
|||||||
+19
-2
@@ -1,6 +1,7 @@
|
|||||||
use std::io::{self, Write};
|
use std::io::{self, Write};
|
||||||
|
use std::path::Path;
|
||||||
|
|
||||||
use app::Config;
|
use app::{Config, PagingMode};
|
||||||
use assets::HighlightingAssets;
|
use assets::HighlightingAssets;
|
||||||
use errors::*;
|
use errors::*;
|
||||||
use inputfile::{InputFile, InputFileReader};
|
use inputfile::{InputFile, InputFileReader};
|
||||||
@@ -19,7 +20,22 @@ impl<'b> Controller<'b> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn run(&self) -> Result<bool> {
|
pub fn run(&self) -> Result<bool> {
|
||||||
let mut output_type = OutputType::from_mode(self.config.paging_mode, self.config.pager)?;
|
// Do not launch the pager if NONE of the input files exist
|
||||||
|
let mut paging_mode = self.config.paging_mode;
|
||||||
|
if self.config.paging_mode != PagingMode::Never {
|
||||||
|
let call_pager = self.config.files.iter().any(|file| {
|
||||||
|
if let InputFile::Ordinary(path) = file {
|
||||||
|
return Path::new(path).exists();
|
||||||
|
} else {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if !call_pager {
|
||||||
|
paging_mode = PagingMode::Never;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
let mut output_type = OutputType::from_mode(paging_mode, self.config.pager)?;
|
||||||
let writer = output_type.handle()?;
|
let writer = output_type.handle()?;
|
||||||
let mut no_errors: bool = true;
|
let mut no_errors: bool = true;
|
||||||
|
|
||||||
@@ -27,6 +43,7 @@ impl<'b> Controller<'b> {
|
|||||||
|
|
||||||
for input_file in &self.config.files {
|
for input_file in &self.config.files {
|
||||||
match input_file.get_reader(&stdin) {
|
match input_file.get_reader(&stdin) {
|
||||||
|
Err(Error(ErrorKind::ImmediateEOF, _)) => (),
|
||||||
Err(error) => {
|
Err(error) => {
|
||||||
handle_error(&error);
|
handle_error(&error);
|
||||||
no_errors = false;
|
no_errors = false;
|
||||||
|
|||||||
+1
-1
@@ -34,7 +34,7 @@ pub fn get_git_diff(filename: &str) -> Option<LineChanges> {
|
|||||||
|
|
||||||
let mark_section =
|
let mark_section =
|
||||||
|line_changes: &mut LineChanges, start: u32, end: i32, change: LineChange| {
|
|line_changes: &mut LineChanges, start: u32, end: i32, change: LineChange| {
|
||||||
for line in start..(end + 1) as u32 {
|
for line in start..=end as u32 {
|
||||||
line_changes.insert(line, change);
|
line_changes.insert(line, change);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
+54
-3
@@ -1,6 +1,57 @@
|
|||||||
use directories::ProjectDirs;
|
use dirs_rs;
|
||||||
|
use std::path::{Path, PathBuf};
|
||||||
|
|
||||||
|
#[cfg(target_os = "macos")]
|
||||||
|
use std::env;
|
||||||
|
|
||||||
|
/// Wrapper for 'dirs' that treats MacOS more like Linux, by following the XDG specification.
|
||||||
|
/// This means that the `XDG_CACHE_HOME` and `XDG_CONFIG_HOME` environment variables are
|
||||||
|
/// checked first. The fallback directories are `~/.cache/bat` and `~/.config/bat`, respectively.
|
||||||
|
pub struct BatProjectDirs {
|
||||||
|
cache_dir: PathBuf,
|
||||||
|
config_dir: PathBuf,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl BatProjectDirs {
|
||||||
|
fn new() -> Option<BatProjectDirs> {
|
||||||
|
#[cfg(target_os = "macos")]
|
||||||
|
let cache_dir_op = env::var_os("XDG_CACHE_HOME")
|
||||||
|
.map(PathBuf::from)
|
||||||
|
.filter(|p| p.is_absolute())
|
||||||
|
.or_else(|| dirs_rs::home_dir().map(|d| d.join(".cache")));
|
||||||
|
|
||||||
|
#[cfg(not(target_os = "macos"))]
|
||||||
|
let cache_dir_op = dirs_rs::cache_dir();
|
||||||
|
|
||||||
|
let cache_dir = cache_dir_op.map(|d| d.join("bat"))?;
|
||||||
|
|
||||||
|
#[cfg(target_os = "macos")]
|
||||||
|
let config_dir_op = env::var_os("XDG_CONFIG_HOME")
|
||||||
|
.map(PathBuf::from)
|
||||||
|
.filter(|p| p.is_absolute())
|
||||||
|
.or_else(|| dirs_rs::home_dir().map(|d| d.join(".config")));
|
||||||
|
|
||||||
|
#[cfg(not(target_os = "macos"))]
|
||||||
|
let config_dir_op = dirs_rs::config_dir();
|
||||||
|
|
||||||
|
let config_dir = config_dir_op.map(|d| d.join("bat"))?;
|
||||||
|
|
||||||
|
Some(BatProjectDirs {
|
||||||
|
cache_dir,
|
||||||
|
config_dir,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn cache_dir(&self) -> &Path {
|
||||||
|
&self.cache_dir
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn config_dir(&self) -> &Path {
|
||||||
|
&self.config_dir
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
lazy_static! {
|
lazy_static! {
|
||||||
pub static ref PROJECT_DIRS: ProjectDirs =
|
pub static ref PROJECT_DIRS: BatProjectDirs =
|
||||||
ProjectDirs::from("", "", crate_name!()).expect("Could not get home directory");
|
BatProjectDirs::new().expect("Could not get home directory");
|
||||||
}
|
}
|
||||||
|
|||||||
+12
-10
@@ -14,9 +14,11 @@ pub struct InputFileReader<'a> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> InputFileReader<'a> {
|
impl<'a> InputFileReader<'a> {
|
||||||
fn new<R: BufRead + 'a>(mut reader: R) -> InputFileReader<'a> {
|
fn new<R: BufRead + 'a>(mut reader: R) -> Result<InputFileReader<'a>> {
|
||||||
let mut first_line = vec![];
|
let mut first_line = vec![];
|
||||||
reader.read_until(b'\n', &mut first_line).ok();
|
if reader.read_until(b'\n', &mut first_line)? == 0 {
|
||||||
|
return Err(ErrorKind::ImmediateEOF.into());
|
||||||
|
}
|
||||||
|
|
||||||
let content_type = content_inspector::inspect(&first_line[..]);
|
let content_type = content_inspector::inspect(&first_line[..]);
|
||||||
|
|
||||||
@@ -24,11 +26,11 @@ impl<'a> InputFileReader<'a> {
|
|||||||
reader.read_until(0x00, &mut first_line).ok();
|
reader.read_until(0x00, &mut first_line).ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
InputFileReader {
|
Ok(InputFileReader {
|
||||||
inner: Box::new(reader),
|
inner: Box::new(reader),
|
||||||
first_line,
|
first_line,
|
||||||
content_type,
|
content_type,
|
||||||
}
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn read_line(&mut self, buf: &mut Vec<u8>) -> io::Result<bool> {
|
pub fn read_line(&mut self, buf: &mut Vec<u8>) -> io::Result<bool> {
|
||||||
@@ -57,17 +59,17 @@ pub enum InputFile<'a> {
|
|||||||
impl<'a> InputFile<'a> {
|
impl<'a> InputFile<'a> {
|
||||||
pub fn get_reader(&self, stdin: &'a io::Stdin) -> Result<InputFileReader> {
|
pub fn get_reader(&self, stdin: &'a io::Stdin) -> Result<InputFileReader> {
|
||||||
match self {
|
match self {
|
||||||
InputFile::StdIn => Ok(InputFileReader::new(stdin.lock())),
|
InputFile::StdIn => InputFileReader::new(stdin.lock()),
|
||||||
InputFile::Ordinary(filename) => {
|
InputFile::Ordinary(filename) => {
|
||||||
let file = File::open(filename)?;
|
let file = File::open(filename).map_err(|e| format!("'{}': {}", filename, e))?;
|
||||||
|
|
||||||
if file.metadata()?.is_dir() {
|
if file.metadata()?.is_dir() {
|
||||||
return Err(format!("'{}' is a directory.", filename).into());
|
return Err(format!("'{}' is a directory.", filename).into());
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(InputFileReader::new(BufReader::new(file)))
|
InputFileReader::new(BufReader::new(file))
|
||||||
}
|
}
|
||||||
InputFile::ThemePreviewFile => Ok(InputFileReader::new(THEME_PREVIEW_FILE)),
|
InputFile::ThemePreviewFile => InputFileReader::new(THEME_PREVIEW_FILE),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -75,7 +77,7 @@ impl<'a> InputFile<'a> {
|
|||||||
#[test]
|
#[test]
|
||||||
fn basic() {
|
fn basic() {
|
||||||
let content = b"#!/bin/bash\necho hello";
|
let content = b"#!/bin/bash\necho hello";
|
||||||
let mut reader = InputFileReader::new(&content[..]);
|
let mut reader = InputFileReader::new(&content[..]).unwrap();
|
||||||
|
|
||||||
assert_eq!(b"#!/bin/bash\n", &reader.first_line[..]);
|
assert_eq!(b"#!/bin/bash\n", &reader.first_line[..]);
|
||||||
|
|
||||||
@@ -104,7 +106,7 @@ fn basic() {
|
|||||||
#[test]
|
#[test]
|
||||||
fn utf16le() {
|
fn utf16le() {
|
||||||
let content = b"\xFF\xFE\x73\x00\x0A\x00\x64\x00";
|
let content = b"\xFF\xFE\x73\x00\x0A\x00\x64\x00";
|
||||||
let mut reader = InputFileReader::new(&content[..]);
|
let mut reader = InputFileReader::new(&content[..]).unwrap();
|
||||||
|
|
||||||
assert_eq!(b"\xFF\xFE\x73\x00\x0A\x00", &reader.first_line[..]);
|
assert_eq!(b"\xFF\xFE\x73\x00\x0A\x00", &reader.first_line[..]);
|
||||||
|
|
||||||
|
|||||||
+14
-7
@@ -14,7 +14,7 @@ extern crate ansi_term;
|
|||||||
extern crate atty;
|
extern crate atty;
|
||||||
extern crate console;
|
extern crate console;
|
||||||
extern crate content_inspector;
|
extern crate content_inspector;
|
||||||
extern crate directories;
|
extern crate dirs as dirs_rs;
|
||||||
extern crate encoding;
|
extern crate encoding;
|
||||||
extern crate git2;
|
extern crate git2;
|
||||||
extern crate shell_words;
|
extern crate shell_words;
|
||||||
@@ -49,7 +49,7 @@ use ansi_term::Colour::Green;
|
|||||||
use ansi_term::Style;
|
use ansi_term::Style;
|
||||||
|
|
||||||
use app::{App, Config};
|
use app::{App, Config};
|
||||||
use assets::{clear_assets, config_dir, HighlightingAssets};
|
use assets::{cache_dir, clear_assets, config_dir, HighlightingAssets};
|
||||||
use config::config_file;
|
use config::config_file;
|
||||||
use controller::Controller;
|
use controller::Controller;
|
||||||
use inputfile::InputFile;
|
use inputfile::InputFile;
|
||||||
@@ -63,6 +63,9 @@ mod errors {
|
|||||||
SyntectError(::syntect::LoadingError);
|
SyntectError(::syntect::LoadingError);
|
||||||
ParseIntError(::std::num::ParseIntError);
|
ParseIntError(::std::num::ParseIntError);
|
||||||
}
|
}
|
||||||
|
errors {
|
||||||
|
ImmediateEOF
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn handle_error(error: &Error) {
|
pub fn handle_error(error: &Error) {
|
||||||
@@ -83,7 +86,7 @@ mod errors {
|
|||||||
use errors::*;
|
use errors::*;
|
||||||
|
|
||||||
fn run_cache_subcommand(matches: &clap::ArgMatches) -> Result<()> {
|
fn run_cache_subcommand(matches: &clap::ArgMatches) -> Result<()> {
|
||||||
if matches.is_present("init") {
|
if matches.is_present("build") {
|
||||||
let source_dir = matches.value_of("source").map(Path::new);
|
let source_dir = matches.value_of("source").map(Path::new);
|
||||||
let target_dir = matches.value_of("target").map(Path::new);
|
let target_dir = matches.value_of("target").map(Path::new);
|
||||||
|
|
||||||
@@ -93,8 +96,6 @@ fn run_cache_subcommand(matches: &clap::ArgMatches) -> Result<()> {
|
|||||||
assets.save(target_dir)?;
|
assets.save(target_dir)?;
|
||||||
} else if matches.is_present("clear") {
|
} else if matches.is_present("clear") {
|
||||||
clear_assets();
|
clear_assets();
|
||||||
} else if matches.is_present("config-dir") {
|
|
||||||
writeln!(io::stdout(), "{}", config_dir())?;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
@@ -195,8 +196,8 @@ fn run_controller(config: &Config) -> Result<bool> {
|
|||||||
controller.run()
|
controller.run()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns `Err(..)` upon fatal errors. Otherwise, returns `Some(true)` on full success and
|
/// Returns `Err(..)` upon fatal errors. Otherwise, returns `Ok(true)` on full success and
|
||||||
/// `Some(false)` if any intermediate errors occurred (were printed).
|
/// `Ok(false)` if any intermediate errors occurred (were printed).
|
||||||
fn run() -> Result<bool> {
|
fn run() -> Result<bool> {
|
||||||
let app = App::new()?;
|
let app = App::new()?;
|
||||||
|
|
||||||
@@ -229,6 +230,12 @@ fn run() -> Result<bool> {
|
|||||||
} else if app.matches.is_present("config-file") {
|
} else if app.matches.is_present("config-file") {
|
||||||
println!("{}", config_file().to_string_lossy());
|
println!("{}", config_file().to_string_lossy());
|
||||||
|
|
||||||
|
Ok(true)
|
||||||
|
} else if app.matches.is_present("config-dir") {
|
||||||
|
writeln!(io::stdout(), "{}", config_dir())?;
|
||||||
|
Ok(true)
|
||||||
|
} else if app.matches.is_present("cache-dir") {
|
||||||
|
writeln!(io::stdout(), "{}", cache_dir())?;
|
||||||
Ok(true)
|
Ok(true)
|
||||||
} else {
|
} else {
|
||||||
run_controller(&config)
|
run_controller(&config)
|
||||||
|
|||||||
+26
-9
@@ -26,43 +26,60 @@ impl OutputType {
|
|||||||
|
|
||||||
/// Try to launch the pager. Fall back to stdout in case of errors.
|
/// Try to launch the pager. Fall back to stdout in case of errors.
|
||||||
fn try_pager(quit_if_one_screen: bool, pager_from_config: Option<&str>) -> Result<Self> {
|
fn try_pager(quit_if_one_screen: bool, pager_from_config: Option<&str>) -> Result<Self> {
|
||||||
let pager_from_env = env::var("BAT_PAGER").or_else(|_| env::var("PAGER"));
|
let mut replace_arguments_to_less = false;
|
||||||
|
|
||||||
|
let pager_from_env = match (env::var("BAT_PAGER"), env::var("PAGER")) {
|
||||||
|
(Ok(bat_pager), _) => Some(bat_pager),
|
||||||
|
(_, Ok(pager)) => {
|
||||||
|
// less needs to be called with the '-R' option in order to properly interpret the
|
||||||
|
// ANSI color sequences printed by bat. If someone has set PAGER="less -F", we
|
||||||
|
// therefore need to overwrite the arguments and add '-R'.
|
||||||
|
//
|
||||||
|
// We only do this for PAGER (as it is not specific to 'bat'), not for BAT_PAGER
|
||||||
|
// or bats '--pager' command line option.
|
||||||
|
replace_arguments_to_less = true;
|
||||||
|
Some(pager)
|
||||||
|
}
|
||||||
|
_ => None,
|
||||||
|
};
|
||||||
|
|
||||||
let pager = pager_from_config
|
let pager = pager_from_config
|
||||||
.map(|p| p.to_string())
|
.map(|p| p.to_string())
|
||||||
.or(pager_from_env.ok())
|
.or(pager_from_env)
|
||||||
.unwrap_or(String::from("less"));
|
.unwrap_or(String::from("less"));
|
||||||
|
|
||||||
let pagerflags = shell_words::split(&pager)
|
let pagerflags =
|
||||||
.chain_err(|| "Could not parse (BAT_)PAGER environment variable.")?;
|
shell_words::split(&pager).chain_err(|| "Could not parse pager command.")?;
|
||||||
|
|
||||||
match pagerflags.split_first() {
|
match pagerflags.split_first() {
|
||||||
Some((pager_name, mut args)) => {
|
Some((pager_name, args)) => {
|
||||||
let mut pager_path = PathBuf::from(pager_name);
|
let mut pager_path = PathBuf::from(pager_name);
|
||||||
|
|
||||||
if pager_path.file_stem() == Some(&OsString::from("bat")) {
|
if pager_path.file_stem() == Some(&OsString::from("bat")) {
|
||||||
pager_path = PathBuf::from("less");
|
pager_path = PathBuf::from("less");
|
||||||
args = &[];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let is_less = pager_path.file_stem() == Some(&OsString::from("less"));
|
let is_less = pager_path.file_stem() == Some(&OsString::from("less"));
|
||||||
|
|
||||||
let mut process = if is_less {
|
let mut process = if is_less {
|
||||||
let mut p = Command::new(&pager_path);
|
let mut p = Command::new(&pager_path);
|
||||||
if args.is_empty() {
|
if args.is_empty() || replace_arguments_to_less {
|
||||||
p.args(vec!["--RAW-CONTROL-CHARS", "--no-init"]);
|
p.args(vec!["--RAW-CONTROL-CHARS", "--no-init"]);
|
||||||
if quit_if_one_screen {
|
if quit_if_one_screen {
|
||||||
p.arg("--quit-if-one-screen");
|
p.arg("--quit-if-one-screen");
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
p.args(args);
|
||||||
}
|
}
|
||||||
p.env("LESSCHARSET", "UTF-8");
|
p.env("LESSCHARSET", "UTF-8");
|
||||||
p
|
p
|
||||||
} else {
|
} else {
|
||||||
Command::new(&pager_path)
|
let mut p = Command::new(&pager_path);
|
||||||
|
p.args(args);
|
||||||
|
p
|
||||||
};
|
};
|
||||||
|
|
||||||
Ok(process
|
Ok(process
|
||||||
.args(args)
|
|
||||||
.stdin(Stdio::piped())
|
.stdin(Stdio::piped())
|
||||||
.spawn()
|
.spawn()
|
||||||
.map(OutputType::Pager)
|
.map(OutputType::Pager)
|
||||||
|
|||||||
+55
-4
@@ -7,6 +7,7 @@ use ansi_term::Style;
|
|||||||
use console::AnsiCodeIterator;
|
use console::AnsiCodeIterator;
|
||||||
|
|
||||||
use syntect::easy::HighlightLines;
|
use syntect::easy::HighlightLines;
|
||||||
|
use syntect::highlighting::Color;
|
||||||
use syntect::highlighting::Theme;
|
use syntect::highlighting::Theme;
|
||||||
use syntect::parsing::SyntaxSet;
|
use syntect::parsing::SyntaxSet;
|
||||||
|
|
||||||
@@ -79,6 +80,7 @@ pub struct InteractivePrinter<'a> {
|
|||||||
pub line_changes: Option<LineChanges>,
|
pub line_changes: Option<LineChanges>,
|
||||||
highlighter: Option<HighlightLines<'a>>,
|
highlighter: Option<HighlightLines<'a>>,
|
||||||
syntax_set: &'a SyntaxSet,
|
syntax_set: &'a SyntaxSet,
|
||||||
|
background_color_highlight: Option<Color>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> InteractivePrinter<'a> {
|
impl<'a> InteractivePrinter<'a> {
|
||||||
@@ -90,6 +92,8 @@ impl<'a> InteractivePrinter<'a> {
|
|||||||
) -> Self {
|
) -> Self {
|
||||||
let theme = assets.get_theme(&config.theme);
|
let theme = assets.get_theme(&config.theme);
|
||||||
|
|
||||||
|
let background_color_highlight = theme.settings.line_highlight;
|
||||||
|
|
||||||
let colors = if config.colored_output {
|
let colors = if config.colored_output {
|
||||||
Colors::colored(theme, config.true_color)
|
Colors::colored(theme, config.true_color)
|
||||||
} else {
|
} else {
|
||||||
@@ -156,6 +160,7 @@ impl<'a> InteractivePrinter<'a> {
|
|||||||
line_changes,
|
line_changes,
|
||||||
highlighter,
|
highlighter,
|
||||||
syntax_set: &assets.syntax_set,
|
syntax_set: &assets.syntax_set,
|
||||||
|
background_color_highlight,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -287,6 +292,17 @@ impl<'a> Printer for InteractivePrinter<'a> {
|
|||||||
let mut cursor_total: usize = 0;
|
let mut cursor_total: usize = 0;
|
||||||
let mut panel_wrap: Option<String> = None;
|
let mut panel_wrap: Option<String> = None;
|
||||||
|
|
||||||
|
// Line highlighting
|
||||||
|
let highlight_this_line = self
|
||||||
|
.config
|
||||||
|
.highlight_lines
|
||||||
|
.iter()
|
||||||
|
.any(|&l| l == line_number);
|
||||||
|
|
||||||
|
let background_color = self
|
||||||
|
.background_color_highlight
|
||||||
|
.filter(|_| highlight_this_line);
|
||||||
|
|
||||||
// Line decorations.
|
// Line decorations.
|
||||||
if self.panel_width > 0 {
|
if self.panel_width > 0 {
|
||||||
let decorations = self
|
let decorations = self
|
||||||
@@ -309,11 +325,33 @@ impl<'a> Printer for InteractivePrinter<'a> {
|
|||||||
|
|
||||||
for &(style, region) in regions.iter() {
|
for &(style, region) in regions.iter() {
|
||||||
let text = &*self.preprocess(region, &mut cursor_total);
|
let text = &*self.preprocess(region, &mut cursor_total);
|
||||||
|
let text_trimmed = text.trim_end_matches(|c| c == '\r' || c == '\n');
|
||||||
write!(
|
write!(
|
||||||
handle,
|
handle,
|
||||||
"{}",
|
"{}",
|
||||||
as_terminal_escaped(style, &*text, true_color, colored_output, italics,)
|
as_terminal_escaped(
|
||||||
|
style,
|
||||||
|
text_trimmed,
|
||||||
|
true_color,
|
||||||
|
colored_output,
|
||||||
|
italics,
|
||||||
|
background_color
|
||||||
|
)
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
|
if text.len() != text_trimmed.len() {
|
||||||
|
if let Some(background_color) = background_color {
|
||||||
|
let mut ansi_style = Style::default();
|
||||||
|
ansi_style.background = Some(to_ansi_color(background_color, true_color));
|
||||||
|
let width = if cursor_total <= cursor_max {
|
||||||
|
cursor_max - cursor_total + 1
|
||||||
|
} else {
|
||||||
|
0
|
||||||
|
};
|
||||||
|
write!(handle, "{}", ansi_style.paint(" ".repeat(width)))?;
|
||||||
|
}
|
||||||
|
write!(handle, "{}", &text[text_trimmed.len()..])?;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if line.bytes().next_back() != Some(b'\n') {
|
if line.bytes().next_back() != Some(b'\n') {
|
||||||
@@ -342,7 +380,7 @@ impl<'a> Printer for InteractivePrinter<'a> {
|
|||||||
// Regular text.
|
// Regular text.
|
||||||
(text, false) => {
|
(text, false) => {
|
||||||
let text = self.preprocess(
|
let text = self.preprocess(
|
||||||
text.trim_right_matches(|c| c == '\r' || c == '\n'),
|
text.trim_end_matches(|c| c == '\r' || c == '\n'),
|
||||||
&mut cursor_total,
|
&mut cursor_total,
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -368,7 +406,8 @@ impl<'a> Printer for InteractivePrinter<'a> {
|
|||||||
),
|
),
|
||||||
self.config.true_color,
|
self.config.true_color,
|
||||||
self.config.colored_output,
|
self.config.colored_output,
|
||||||
self.config.use_italic_text
|
self.config.use_italic_text,
|
||||||
|
background_color
|
||||||
)
|
)
|
||||||
)?;
|
)?;
|
||||||
break;
|
break;
|
||||||
@@ -408,7 +447,8 @@ impl<'a> Printer for InteractivePrinter<'a> {
|
|||||||
),
|
),
|
||||||
self.config.true_color,
|
self.config.true_color,
|
||||||
self.config.colored_output,
|
self.config.colored_output,
|
||||||
self.config.use_italic_text
|
self.config.use_italic_text,
|
||||||
|
background_color
|
||||||
),
|
),
|
||||||
panel_wrap.clone().unwrap()
|
panel_wrap.clone().unwrap()
|
||||||
)?;
|
)?;
|
||||||
@@ -421,6 +461,17 @@ impl<'a> Printer for InteractivePrinter<'a> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if let Some(background_color) = background_color {
|
||||||
|
let mut ansi_style = Style::default();
|
||||||
|
ansi_style.background =
|
||||||
|
Some(to_ansi_color(background_color, self.config.true_color));
|
||||||
|
|
||||||
|
write!(
|
||||||
|
handle,
|
||||||
|
"{}",
|
||||||
|
ansi_style.paint(" ".repeat(cursor_max - cursor))
|
||||||
|
)?;
|
||||||
|
}
|
||||||
write!(handle, "\n")?;
|
write!(handle, "\n")?;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,24 +9,24 @@ impl SyntaxMapping {
|
|||||||
SyntaxMapping(HashMap::new())
|
SyntaxMapping(HashMap::new())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn insert(&mut self, from: String, to: String) -> Option<String> {
|
pub fn insert(&mut self, from: impl Into<String>, to: impl Into<String>) -> Option<String> {
|
||||||
self.0.insert(from, to)
|
self.0.insert(from.into(), to.into())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn replace<'a>(&self, input: &'a str) -> Cow<'a, str> {
|
pub fn replace<'a>(&self, input: impl Into<Cow<'a, str>>) -> Cow<'a, str> {
|
||||||
let mut out = Cow::from(input);
|
let input = input.into();
|
||||||
if let Some(value) = self.0.get(input) {
|
match self.0.get(input.as_ref()) {
|
||||||
out = Cow::from(value.clone())
|
Some(s) => Cow::from(s.clone()),
|
||||||
|
None => input,
|
||||||
}
|
}
|
||||||
out
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn basic() {
|
fn basic() {
|
||||||
let mut map = SyntaxMapping::new();
|
let mut map = SyntaxMapping::new();
|
||||||
map.insert("Cargo.lock".into(), "toml".into());
|
map.insert("Cargo.lock", "toml");
|
||||||
map.insert(".ignore".into(), ".gitignore".into());
|
map.insert(".ignore", ".gitignore");
|
||||||
|
|
||||||
assert_eq!("toml", map.replace("Cargo.lock"));
|
assert_eq!("toml", map.replace("Cargo.lock"));
|
||||||
assert_eq!("other.lock", map.replace("other.lock"));
|
assert_eq!("other.lock", map.replace("other.lock"));
|
||||||
|
|||||||
+3
-1
@@ -19,8 +19,9 @@ pub fn as_terminal_escaped(
|
|||||||
true_color: bool,
|
true_color: bool,
|
||||||
colored: bool,
|
colored: bool,
|
||||||
italics: bool,
|
italics: bool,
|
||||||
|
background_color: Option<highlighting::Color>,
|
||||||
) -> String {
|
) -> String {
|
||||||
let style = if !colored {
|
let mut style = if !colored {
|
||||||
Style::default()
|
Style::default()
|
||||||
} else {
|
} else {
|
||||||
let color = to_ansi_color(style.foreground, true_color);
|
let color = to_ansi_color(style.foreground, true_color);
|
||||||
@@ -36,5 +37,6 @@ pub fn as_terminal_escaped(
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
style.background = background_color.map(|c| to_ansi_color(c, true_color));
|
||||||
style.paint(text).to_string()
|
style.paint(text).to_string()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
examples/* linguist-vendored
|
||||||
|
snapshots/* linguist-vendored
|
||||||
|
benchmarks/* linguist-vendored
|
||||||
|
benchmarks/test-src/* linguist-vendored
|
||||||
Vendored
-1
@@ -1 +0,0 @@
|
|||||||
test-src/* linguist-vendored
|
|
||||||
Reference in New Issue
Block a user