diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index d0f4090f..00000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1,3 +0,0 @@ -# These are supported funding model platforms - -github: sharkdp diff --git a/.gitmodules b/.gitmodules index cac62a7d..62a3e51d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,32 +1,32 @@ [submodule "assets/syntaxes/Elixir"] - path = assets/syntaxes/Elixir + path = assets/syntaxes/02_Extra/Elixir url = https://github.com/princemaple/elixir-sublime-syntax/ [submodule "assets/syntaxes/Packages"] - path = assets/syntaxes/Packages + path = assets/syntaxes/01_Packages url = https://github.com/sublimehq/Packages/ [submodule "assets/syntaxes/TOML"] - path = assets/syntaxes/TOML + path = assets/syntaxes/02_Extra/TOML url = https://github.com/jasonwilliams/sublime_toml_highlighting [submodule "assets/syntaxes/Julia"] - path = assets/syntaxes/Julia + path = assets/syntaxes/02_Extra/Julia url = https://github.com/JuliaEditorSupport/Julia-sublime [submodule "assets/themes/sublime-monokai-extended"] path = assets/themes/sublime-monokai-extended url = https://github.com/jonschlinkert/sublime-monokai-extended [submodule "assets/syntaxes/Docker"] - path = assets/syntaxes/Docker + path = assets/syntaxes/02_Extra/Docker url = https://github.com/asbjornenge/Docker.tmbundle [submodule "assets/syntaxes/VimL"] - path = assets/syntaxes/VimL + path = assets/syntaxes/02_Extra/VimL url = https://github.com/SalGnt/Sublime-VimL [submodule "assets/syntaxes/INI"] - path = assets/syntaxes/INI + path = assets/syntaxes/02_Extra/INI url = https://github.com/clintberry/sublime-text-2-ini [submodule "assets/syntaxes/CMake"] - path = assets/syntaxes/CMake + path = assets/syntaxes/02_Extra/CMake url = https://github.com/zyxar/Sublime-CMakeLists [submodule "assets/syntaxes/LESS"] - path = assets/syntaxes/LESS + path = assets/syntaxes/02_Extra/LESS url = https://github.com/danro/LESS-sublime [submodule "assets/themes/DarkNeon"] path = assets/themes/DarkNeon @@ -41,127 +41,127 @@ path = assets/themes/TwoDark url = https://github.com/erremauro/TwoDark [submodule "assets/syntaxes/AWK"] - path = assets/syntaxes/AWK + path = assets/syntaxes/02_Extra/AWK url = https://github.com/JohnNilsson/awk-sublime [submodule "assets/syntaxes/Nix"] - path = assets/syntaxes/Nix + path = assets/syntaxes/02_Extra/Nix url = https://github.com/wmertens/sublime-nix [submodule "assets/themes/zenburn"] path = assets/themes/zenburn url = https://github.com/colinta/zenburn.git [submodule "assets/syntaxes/Kotlin"] - path = assets/syntaxes/Kotlin + path = assets/syntaxes/02_Extra/Kotlin url = https://github.com/vkostyukov/kotlin-sublime-package [submodule "assets/syntaxes/Elm"] - path = assets/syntaxes/Elm + path = assets/syntaxes/02_Extra/Elm url = https://github.com/elm-community/SublimeElmLanguageSupport [submodule "assets/syntaxes/TypeScript"] - path = assets/syntaxes/TypeScript + path = assets/syntaxes/02_Extra/TypeScript url = https://github.com/Microsoft/TypeScript-Sublime-Plugin [submodule "assets/syntaxes/Puppet"] - path = assets/syntaxes/Puppet + path = assets/syntaxes/02_Extra/Puppet url = https://github.com/russCloak/SublimePuppet [submodule "assets/syntaxes/CSV"] - path = assets/syntaxes/CSV + path = assets/syntaxes/02_Extra/CSV url = https://github.com/wadetb/Sublime-Text-Advanced-CSV [submodule "assets/themes/onehalf"] path = assets/themes/onehalf url = https://github.com/sonph/onehalf [submodule "assets/syntaxes/JavaScript (Babel)"] - path = assets/syntaxes/JavaScript (Babel) + path = assets/syntaxes/02_Extra/JavaScript (Babel) url = https://github.com/babel/babel-sublime [submodule "assets/syntaxes/Cabal"] - path = assets/syntaxes/Cabal + path = assets/syntaxes/02_Extra/Cabal url = https://github.com/SublimeHaskell/SublimeHaskell [submodule "assets/syntaxes/Dart"] - path = assets/syntaxes/Dart + path = assets/syntaxes/02_Extra/Dart url = https://github.com/guillermooo/dart-sublime-bundle [submodule "assets/syntaxes/FSharp"] - path = assets/syntaxes/FSharp + path = assets/syntaxes/02_Extra/FSharp url = https://github.com/hoest/sublimetext-fsharp [submodule "assets/syntaxes/PureScript"] - path = assets/syntaxes/PureScript + path = assets/syntaxes/02_Extra/PureScript url = https://github.com/tellnobody1/sublime-purescript-syntax [submodule "assets/syntaxes/Swift"] - path = assets/syntaxes/Swift + path = assets/syntaxes/02_Extra/Swift url = https://github.com/quiqueg/Swift-Sublime-Package [submodule "assets/syntaxes/Crystal"] - path = assets/syntaxes/Crystal + path = assets/syntaxes/02_Extra/Crystal url = https://github.com/crystal-lang-tools/sublime-crystal.git [submodule "assets/syntaxes/PowerShell"] - path = assets/syntaxes/PowerShell + path = assets/syntaxes/02_Extra/PowerShell url = https://github.com/PowerShell/EditorSyntax [submodule "assets/syntaxes/Robot"] - path = assets/syntaxes/Robot + path = assets/syntaxes/02_Extra/Robot url = https://github.com/andriyko/sublime-robot-framework-assistant.git [submodule "assets/themes/sublime-snazzy"] path = assets/themes/sublime-snazzy url = https://github.com/greggb/sublime-snazzy [submodule "assets/syntaxes/AsciiDoc"] - path = assets/syntaxes/AsciiDoc + path = assets/syntaxes/02_Extra/AsciiDoc url = https://github.com/SublimeText/AsciiDoc.git [submodule "assets/syntaxes/Assembly (ARM)"] - path = assets/syntaxes/Assembly (ARM) + path = assets/syntaxes/02_Extra/Assembly (ARM) url = https://github.com/tvi/Sublime-ARM-Assembly [submodule "assets/syntaxes/syslog-syntax"] - path = assets/syntaxes/Syslog + path = assets/syntaxes/02_Extra/Syslog url = https://github.com/caos21/syslog-syntax.git branch = master [submodule "assets/syntaxes/protobuf-syntax-highlighting"] - path = assets/syntaxes/Protobuf + path = assets/syntaxes/02_Extra/Protobuf url = https://github.com/VcamX/protobuf-syntax-highlighting.git branch = master [submodule "assets/syntaxes/Terraform"] - path = assets/syntaxes/Terraform + path = assets/syntaxes/02_Extra/Terraform url = https://github.com/alexlouden/Terraform.tmLanguage.git [submodule "assets/syntaxes/Jsonnet"] - path = assets/syntaxes/Jsonnet + path = assets/syntaxes/02_Extra/Jsonnet url = https://github.com/gburiola/sublime-jsonnet-syntax.git [submodule "assets/syntaxes/varlink"] - path = assets/syntaxes/varlink + path = assets/syntaxes/02_Extra/varlink url = https://github.com/varlink/syntax-highlight-varlink.git [submodule "assets/syntaxes/sublime-fish"] - path = assets/syntaxes/Fish + path = assets/syntaxes/02_Extra/Fish url = https://github.com/Phidica/sublime-fish.git [submodule "assets/syntaxes/Org mode"] - path = assets/syntaxes/Org mode + path = assets/syntaxes/02_Extra/Org mode url = https://github.com/jezcope/Org.tmbundle.git [submodule "assets/syntaxes/requirementstxt"] - path = assets/syntaxes/requirementstxt + path = assets/syntaxes/02_Extra/requirementstxt url = https://github.com/wuub/requirementstxt [submodule "assets/syntaxes/DotENV"] - path = assets/syntaxes/DotENV + path = assets/syntaxes/02_Extra/DotENV url = https://github.com/zaynali53/DotENV [submodule "assets/syntaxes/hosts"] - path = assets/syntaxes/hosts + path = assets/syntaxes/02_Extra/hosts url = https://github.com/brandonwamboldt/sublime-hosts [submodule "assets/syntaxes/ssh-config"] - path = assets/syntaxes/ssh-config + path = assets/syntaxes/02_Extra/ssh-config url = https://github.com/robballou/sublimetext-sshconfig.git [submodule "assets/syntaxes/GraphQL"] - path = assets/syntaxes/GraphQL + path = assets/syntaxes/02_Extra/GraphQL url = https://github.com/dncrews/GraphQL-SublimeText3.git [submodule "assets/syntaxes/Verilog"] - path = assets/syntaxes/Verilog + path = assets/syntaxes/02_Extra/Verilog url = https://github.com/pro711/sublime-verilog [submodule "assets/syntaxes/SCSS_Sass"] - path = assets/syntaxes/SCSS_Sass + path = assets/syntaxes/02_Extra/SCSS_Sass url = https://github.com/braver/SublimeSass [submodule "assets/syntaxes/Strace"] - path = assets/syntaxes/Strace + path = assets/syntaxes/02_Extra/Strace url = https://github.com/djuretic/SublimeStrace [submodule "assets/syntaxes/Jinja2"] - path = assets/syntaxes/Jinja2 + path = assets/syntaxes/02_Extra/Jinja2 url = https://github.com/Martin819/sublime-jinja2 [submodule "assets/syntaxes/SLS"] - path = assets/syntaxes/SLS + path = assets/syntaxes/02_Extra/SLS url = https://github.com/saltstack/sublime-text branch = master [submodule "assets/themes/dracula-sublime"] path = assets/themes/dracula-sublime url = https://github.com/dracula/sublime.git [submodule "assets/syntaxes/HTML (Twig)"] - path = assets/syntaxes/HTML (Twig) + path = assets/syntaxes/02_Extra/HTML (Twig) url = https://github.com/Anomareh/PHP-Twig.tmbundle.git [submodule "assets/themes/Nord-sublime"] path = assets/themes/Nord-sublime @@ -170,9 +170,9 @@ path = assets/themes/solarized-sublime url = https://github.com/paulcpederson/solarized-sublime.git [submodule "assets/syntaxes/Vue"] - path = assets/syntaxes/Vue + path = assets/syntaxes/02_Extra/Vue url = https://github.com/vuejs/vue-syntax-highlight.git branch = new [submodule "assets/syntaxes/CoffeeScript"] - path = assets/syntaxes/CoffeeScript + path = assets/syntaxes/02_Extra/CoffeeScript url = https://github.com/sustained/CoffeeScript-Sublime-Plugin diff --git a/.travis.yml b/.travis.yml index b425b2ce..7b151bfe 100644 --- a/.travis.yml +++ b/.travis.yml @@ -33,15 +33,15 @@ matrix: # Minimum Rust supported channel. - os: linux - rust: 1.36.0 + rust: 1.37.0 env: TARGET=x86_64-unknown-linux-gnu - os: linux - rust: 1.36.0 + rust: 1.37.0 env: - TARGET=x86_64-unknown-linux-musl - CC_x86_64_unknown_linux_musl=/usr/bin/musl-gcc - os: osx - rust: 1.36.0 + rust: 1.37.0 env: TARGET=x86_64-apple-darwin # Disable nightly for now diff --git a/Cargo.lock b/Cargo.lock index 921098ba..87fbc7d2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,15 +2,15 @@ # It is not intended for manual editing. [[package]] name = "adler32" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "aho-corasick" -version = "0.7.6" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -18,7 +18,7 @@ name = "ansi_colours" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cc 1.0.45 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -44,25 +44,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "arrayref" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "arrayvec" -version = "0.4.11" +version = "0.5.1" 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.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "doc-comment 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "doc-comment 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "escargot 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", - "predicates 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "predicates 1.0.4 (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)", ] @@ -73,33 +70,33 @@ version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "hermit-abi 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.68 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "autocfg" -version = "0.1.6" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "backtrace" -version = "0.3.35" +version = "0.3.45" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "backtrace-sys 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)", - "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", + "backtrace-sys 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.68 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-demangle 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "backtrace-sys" -version = "0.1.31" +version = "0.1.34" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cc 1.0.45 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.68 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -107,12 +104,17 @@ name = "base64" version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "base64" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "bat" -version = "0.12.1" +version = "0.13.0" dependencies = [ "ansi_colours 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "ansi_term 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -123,10 +125,11 @@ dependencies = [ "content_inspector 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", "dirs 2.0.2 (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.1 (registry+https://github.com/rust-lang/crates.io-index)", - "git2 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "error-chain 0.12.2 (registry+https://github.com/rust-lang/crates.io-index)", + "git2 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", + "globset 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "liquid 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)", + "liquid 0.20.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.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", @@ -136,22 +139,21 @@ dependencies = [ [[package]] name = "bincode" -version = "1.1.4" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "autocfg 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "bindgen" -version = "0.50.0" +version = "0.50.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "cexpr 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", - "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "cexpr 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", "clang-sys 0.28.1 (registry+https://github.com/rust-lang/crates.io-index)", "clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)", "env_logger 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -161,24 +163,24 @@ dependencies = [ "peeking_take_while 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.3.5 (registry+https://github.com/rust-lang/crates.io-index)", "shlex 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "which 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "bitflags" -version = "1.1.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "blake2b_simd" -version = "0.5.7" +version = "0.5.10" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "arrayref 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", - "arrayvec 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", - "constant_time_eq 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "arrayref 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "arrayvec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "constant_time_eq 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -186,20 +188,28 @@ name = "block-buffer" version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "block-padding 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "block-padding 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "byte-tools 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "block-padding" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "byte-tools 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "bstr" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "byte-tools" version = "0.3.1" @@ -207,21 +217,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "byteorder" -version = "1.3.2" +version = "1.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "cc" -version = "1.0.45" +version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "jobserver 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 1.10.1 (registry+https://github.com/rust-lang/crates.io-index)", + "jobserver 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "cexpr" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "nom 4.2.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -229,17 +238,16 @@ dependencies = [ [[package]] name = "cfg-if" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "chrono" -version = "0.4.9" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", - "num-integer 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "num-integer 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -249,7 +257,7 @@ version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "glob 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.68 (registry+https://github.com/rust-lang/crates.io-index)", "libloading 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -260,7 +268,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", "atty 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", - "bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "term_size 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -275,18 +283,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "atty 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.68 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "cloudabi" -version = "0.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "console" version = "0.10.0" @@ -295,8 +295,8 @@ dependencies = [ "clicolors-control 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "encode_unicode 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.68 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.3.5 (registry+https://github.com/rust-lang/crates.io-index)", "termios 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-width 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -304,7 +304,7 @@ dependencies = [ [[package]] name = "constant_time_eq" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -312,7 +312,7 @@ name = "content_inspector" version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -320,23 +320,19 @@ name = "crc32fast" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "crossbeam-utils" -version = "0.6.6" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "deunicode" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "difference" version = "2.0.0" @@ -355,7 +351,7 @@ name = "dirs" version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", "dirs-sys 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -364,15 +360,15 @@ name = "dirs-sys" version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", - "redox_users 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.68 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_users 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "doc-comment" -version = "0.3.1" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -448,18 +444,18 @@ version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "atty 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", - "humantime 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "humantime 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "termcolor 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "termcolor 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "error-chain" -version = "0.12.1" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "version_check 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -469,28 +465,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.48 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "failure" -version = "0.1.5" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "backtrace 0.3.35 (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.30 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.44 (registry+https://github.com/rust-lang/crates.io-index)", - "synstructure 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)", + "backtrace 0.3.45 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -500,13 +484,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "flate2" -version = "1.0.11" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", "crc32fast 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", - "miniz-sys 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", - "miniz_oxide 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.68 (registry+https://github.com/rust-lang/crates.io-index)", + "miniz_oxide 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -524,7 +508,7 @@ name = "fxhash" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -537,24 +521,24 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.1.12" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", - "wasi 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.68 (registry+https://github.com/rust-lang/crates.io-index)", + "wasi 0.9.0+wasi-snapshot-preview1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "git2" -version = "0.12.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", - "libgit2-sys 0.11.0+0.99.0 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.68 (registry+https://github.com/rust-lang/crates.io-index)", + "libgit2-sys 0.12.0+0.99.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "url 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "url 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -562,20 +546,32 @@ name = "glob" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "globset" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "aho-corasick 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", + "bstr 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)", + "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.3.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "hermit-abi" version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.68 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "humantime" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "quick-error 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -585,7 +581,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-normalization 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-normalization 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -595,12 +591,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-normalization 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-normalization 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "itertools" -version = "0.8.0" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -608,17 +604,15 @@ dependencies = [ [[package]] name = "itoa" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "jobserver" -version = "0.1.17" +version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "getrandom 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.68 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -630,6 +624,14 @@ dependencies = [ "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "kstring" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "lazy_static" version = "1.4.0" @@ -642,18 +644,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "libc" -version = "0.2.62" +version = "0.2.68" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "libgit2-sys" -version = "0.11.0+0.99.0" +version = "0.12.0+0.99.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cc 1.0.45 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.68 (registry+https://github.com/rust-lang/crates.io-index)", "libz-sys 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)", - "pkg-config 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", + "pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -661,7 +663,7 @@ name = "libloading" version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cc 1.0.45 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -670,10 +672,10 @@ name = "libz-sys" version = "1.0.25" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cc 1.0.45 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", - "pkg-config 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", - "vcpkg 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.68 (registry+https://github.com/rust-lang/crates.io-index)", + "pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)", + "vcpkg 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -681,7 +683,7 @@ name = "line-wrap" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "safemem 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "safemem 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -691,78 +693,56 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "liquid" -version = "0.19.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "chrono 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)", - "deunicode 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "doc-comment 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "itertools 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "liquid-compiler 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)", - "liquid-derive 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)", - "liquid-error 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)", - "liquid-interpreter 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)", - "liquid-value 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-segmentation 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", + "doc-comment 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "kstring 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "liquid-core 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)", + "liquid-derive 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)", + "liquid-lib 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "liquid-compiler" -version = "0.19.0" +name = "liquid-core" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "itertools 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", - "liquid-error 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)", - "liquid-interpreter 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)", - "liquid-value 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)", - "pest 2.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "anymap 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)", + "chrono 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", + "itertools 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", + "kstring 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "liquid-derive 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", + "pest 2.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "pest_derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "liquid-derive" -version = "0.19.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "liquid-compiler 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)", - "liquid-error 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)", - "liquid-interpreter 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)", - "liquid-value 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)", - "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", - "proc-quote 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.44 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-quote 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "liquid-error" -version = "0.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "liquid-interpreter" -version = "0.19.0" +name = "liquid-lib" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "anymap 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)", - "itertools 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", - "liquid-error 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)", - "liquid-value 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "liquid-value" -version = "0.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "chrono 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)", - "itertools 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", - "liquid-error 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", + "chrono 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", + "itertools 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", + "kstring 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "liquid-core 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)", + "once_cell 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-segmentation 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)", + "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -770,7 +750,7 @@ name = "log" version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -785,73 +765,56 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "memchr" -version = "2.2.1" +version = "2.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "miniz-sys" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "cc 1.0.45 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "miniz_oxide" -version = "0.3.2" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "adler32 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "adler32 1.0.4 (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]] name = "nom" version = "4.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "num-integer" -version = "0.1.41" +version = "0.1.42" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "autocfg 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "num-traits" -version = "0.2.8" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "autocfg 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "num_cpus" -version = "1.10.1" +name = "once_cell" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", -] [[package]] name = "onig" version = "5.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.68 (registry+https://github.com/rust-lang/crates.io-index)", "onig_sys 69.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -860,9 +823,9 @@ name = "onig_sys" version = "69.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "bindgen 0.50.0 (registry+https://github.com/rust-lang/crates.io-index)", - "cc 1.0.45 (registry+https://github.com/rust-lang/crates.io-index)", - "pkg-config 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", + "bindgen 0.50.1 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)", + "pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -887,10 +850,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "pest" -version = "2.1.2" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "ucd-trie 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "ucd-trie 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -898,35 +861,35 @@ name = "pest_derive" version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "pest 2.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "pest_generator 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "pest 2.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "pest_generator 2.1.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "pest_generator" -version = "2.1.1" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "pest 2.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "pest_meta 2.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "proc-macro2 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "pest 2.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "pest_meta 2.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "pest_meta" -version = "2.1.2" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "maplit 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "pest 2.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "sha-1 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", + "pest 2.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "sha-1 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "pkg-config" -version = "0.3.15" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -935,16 +898,16 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", - "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "humantime 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "humantime 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "line-wrap 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", "xml-rs 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "predicates" -version = "1.0.1" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "difference 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -967,13 +930,8 @@ dependencies = [ [[package]] name = "proc-macro-hack" -version = "0.5.9" +version = "0.5.14" source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "proc-macro2 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", -] [[package]] name = "proc-macro2" @@ -985,7 +943,7 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.2" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -993,29 +951,29 @@ dependencies = [ [[package]] name = "proc-quote" -version = "0.2.2" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro-hack 0.5.9 (registry+https://github.com/rust-lang/crates.io-index)", - "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", - "proc-quote-impl 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.44 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro-hack 0.5.14 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-quote-impl 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "proc-quote-impl" -version = "0.2.2" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro-hack 0.5.9 (registry+https://github.com/rust-lang/crates.io-index)", - "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro-hack 0.5.14 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "quick-error" -version = "1.2.2" +version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -1028,10 +986,10 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1040,7 +998,7 @@ version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.68 (registry+https://github.com/rust-lang/crates.io-index)", "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1059,19 +1017,6 @@ name = "rand_core" version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "rand_os" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", - "fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "rdrand" version = "0.4.0" @@ -1087,29 +1032,28 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "redox_users" -version = "0.3.1" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_os 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", - "rust-argon2 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rust-argon2 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "regex" -version = "1.3.1" +version = "1.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "aho-corasick 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)", - "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "regex-syntax 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", - "thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "aho-corasick 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "regex-syntax 0.6.17 (registry+https://github.com/rust-lang/crates.io-index)", + "thread_local 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "regex-syntax" -version = "0.6.12" +version = "0.6.17" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -1122,12 +1066,13 @@ dependencies = [ [[package]] name = "rust-argon2" -version = "0.5.1" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", - "blake2b_simd 0.5.7 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", + "base64 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "blake2b_simd 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)", + "constant_time_eq 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1137,53 +1082,53 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "ryu" -version = "1.0.0" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "safemem" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "same-file" -version = "1.0.5" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "winapi-util 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-util 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "serde" -version = "1.0.99" +version = "1.0.105" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde_derive 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "serde_derive" -version = "1.0.99" +version = "1.0.105" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "serde_json" -version = "1.0.40" +version = "1.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", - "ryu 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", + "itoa 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "ryu 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "sha-1" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "block-buffer 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1204,7 +1149,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "smallvec" -version = "0.6.10" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -1214,53 +1159,32 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "syn" -version = "0.15.44" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.6.13 (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 = "syn" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "proc-macro2 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "synstructure" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.44 (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 = "syntect" version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "bincode 1.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "flate2 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", + "bincode 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "flate2 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "lazycell 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "onig 5.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "plist 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "regex-syntax 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)", - "walkdir 2.2.9 (registry+https://github.com/rust-lang/crates.io-index)", + "regex-syntax 0.6.17 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.48 (registry+https://github.com/rust-lang/crates.io-index)", + "walkdir 2.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "yaml-rust 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1279,16 +1203,16 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.68 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "termcolor" -version = "1.0.5" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "wincolor 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-util 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1296,7 +1220,7 @@ name = "termios" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.68 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1310,7 +1234,7 @@ dependencies = [ [[package]] name = "thread_local" -version = "0.3.6" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1321,7 +1245,7 @@ name = "time" version = "0.1.42" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.68 (registry+https://github.com/rust-lang/crates.io-index)", "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1338,7 +1262,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "ucd-trie" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -1351,15 +1275,15 @@ dependencies = [ [[package]] name = "unicode-normalization" -version = "0.1.8" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "smallvec 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)", + "smallvec 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "unicode-segmentation" -version = "1.3.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -1389,7 +1313,7 @@ dependencies = [ [[package]] name = "url" -version = "2.1.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "idna 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1399,7 +1323,7 @@ dependencies = [ [[package]] name = "vcpkg" -version = "0.2.7" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -1412,19 +1336,24 @@ name = "version_check" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "version_check" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "walkdir" -version = "2.2.9" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "same-file 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "same-file 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi-util 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-util 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "wasi" -version = "0.7.0" +version = "0.9.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -1432,8 +1361,8 @@ name = "which" version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", + "failure 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.68 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1470,7 +1399,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "winapi-util" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1481,15 +1410,6 @@ name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "wincolor" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi-util 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "xml-rs" version = "0.8.0" @@ -1504,47 +1424,47 @@ dependencies = [ ] [metadata] -"checksum adler32 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "7e522997b529f05601e05166c07ed17789691f562762c7f3b987263d2dedee5c" -"checksum aho-corasick 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)" = "58fb5e95d83b38284460a5fda7d6470aa0b8844d283a0b614b8535e880800d2d" +"checksum adler32 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "5d2e7343e7fc9de883d1b0341e0b13970f764c14101234857d2ddafa1cb1cac2" +"checksum aho-corasick 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)" = "8716408b8bc624ed7f65d223ddb9ac2d044c0547b6fa4b0d554f3a9540496ada" "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.12.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" "checksum anymap 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)" = "33954243bd79057c2de7338850b85983a44588021f8a5fee574a8888c6de4344" -"checksum arrayref 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "0d382e583f07208808f6b1249e60848879ba3543f57c32277bf52d69c2f0f0ee" -"checksum arrayvec 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)" = "b8d73f9beda665eaa98ab9e4f7442bd4e7de6652587de55b2525e52e29c1b0ba" +"checksum arrayref 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544" +"checksum arrayvec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cff77d8686867eceff3105329d4698d96c2391c176d5d03adc90c7389162b5b8" "checksum assert_cmd 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6283bac8dd7226470d491bc4737816fea4ca1fba7a2847f2e9097fd6bfb4624c" "checksum atty 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -"checksum autocfg 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "b671c8fb71b457dd4ae18c4ba1e59aa81793daacc361d82fcd410cef0d491875" -"checksum backtrace 0.3.35 (registry+https://github.com/rust-lang/crates.io-index)" = "1371048253fa3bac6704bfd6bbfc922ee9bdcee8881330d40f308b81cc5adc55" -"checksum backtrace-sys 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)" = "82a830b4ef2d1124a711c71d263c5abdc710ef8e907bd508c88be475cebc422b" +"checksum autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" +"checksum backtrace 0.3.45 (registry+https://github.com/rust-lang/crates.io-index)" = "ad235dabf00f36301792cfe82499880ba54c6486be094d1047b02bacb67c14e8" +"checksum backtrace-sys 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)" = "ca797db0057bae1a7aa2eef3283a874695455cecf08a43bfb8507ee0ebc1ed69" "checksum base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0b25d992356d2eb0ed82172f5248873db5560c4721f564b13cb5193bda5e668e" -"checksum bincode 1.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "9f04a5e50dc80b3d5d35320889053637d15011aed5e66b66b37ae798c65da6f7" -"checksum bindgen 0.50.0 (registry+https://github.com/rust-lang/crates.io-index)" = "65a913de3fa2fa95f2c593bb7e33b1be1ce1ce8a83f34b6bb02e6f01400b96cc" -"checksum bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3d155346769a6855b86399e9bc3814ab343cd3d62c7e985113d46a0ec3c281fd" -"checksum blake2b_simd 0.5.7 (registry+https://github.com/rust-lang/crates.io-index)" = "bf775a81bb2d464e20ff170ac20316c7b08a43d11dbc72f0f82e8e8d3d6d0499" +"checksum base64 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b41b7ea54a0c9d92199de89e20e58d49f02f8e699814ef3fdf266f6f748d15c7" +"checksum bincode 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5753e2a71534719bf3f4e57006c3a4f0d2c672a4b676eec84161f763eca87dbf" +"checksum bindgen 0.50.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cb0e5a5f74b2bafe0b39379f616b5975e08bcaca4e779c078d5c31324147e9ba" +"checksum bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" +"checksum blake2b_simd 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)" = "d8fb2d74254a3a0b5cac33ac9f8ed0e44aa50378d9dbb2e5d83bd21ed1dc2c8a" "checksum block-buffer 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" -"checksum block-padding 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "6d4dc3af3ee2e12f3e5d224e5e1e3d73668abbeb69e566d361f7d5563a4fdf09" +"checksum block-padding 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5" +"checksum bstr 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)" = "2889e6d50f394968c8bf4240dc3f2a7eb4680844d27308f798229ac9d4725f41" "checksum byte-tools 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" -"checksum byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a7c3dd8985a7111efc5c80b44e23ecdd8c007de8ade3b96595387e812b957cf5" -"checksum cc 1.0.45 (registry+https://github.com/rust-lang/crates.io-index)" = "4fc9a35e1f4290eb9e5fc54ba6cf40671ed2a2514c3eeb2b2a908dda2ea5a1be" -"checksum cexpr 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "a7fa24eb00d5ffab90eaeaf1092ac85c04c64aaf358ea6f84505b8116d24c6af" -"checksum cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "b486ce3ccf7ffd79fdeb678eac06a9e6c09fc88d33836340becb8fffe87c5e33" -"checksum chrono 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e8493056968583b0193c1bb04d6f7684586f3726992d6c573261941a895dbd68" +"checksum byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" +"checksum cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)" = "95e28fa049fda1c330bcf9d723be7663a899c4679724b34c81e9f5a326aab8cd" +"checksum cexpr 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "fce5b5fb86b0c57c20c834c1b412fd09c77c8a59b9473f86272709e78874cd1d" +"checksum cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" +"checksum chrono 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)" = "80094f509cf8b5ae86a4966a39b3ff66cd7e2a3e594accec3743ff3fabeab5b2" "checksum clang-sys 0.28.1 (registry+https://github.com/rust-lang/crates.io-index)" = "81de550971c976f176130da4b2978d3b524eaa0fd9ac31f3ceb5ae1231fb4853" "checksum clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5067f5bb2d80ef5d68b4c87db81601f0b75bca627bc2ef76b141d7b846a3c6d9" "checksum clicolors-control 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "90082ee5dcdd64dc4e9e0d37fbf3ee325419e39c0092191e0393df65518f741e" -"checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" "checksum console 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6728a28023f207181b193262711102bfbaf47cc9d13bc71d0736607ef8efe88c" -"checksum constant_time_eq 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "995a44c877f9212528ccc74b21a232f66ad69001e40ede5bcee2ac9ef2657120" +"checksum constant_time_eq 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" "checksum content_inspector 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "b7bda66e858c683005a53a9a60c69a4aca7eeaa45d124526e389f7aec8e62f38" "checksum crc32fast 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ba125de2af0df55319f41944744ad91c71113bf74a4646efff39afe1f6842db1" -"checksum crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)" = "04973fa96e96579258a5091af6003abde64af786b860f18622b82e026cca60e6" -"checksum deunicode 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ca8a0f5bbdedde60605d0719b998e282af68e2b1c50203110211fe4abe857560" +"checksum crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8" "checksum difference 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "524cbf6897b527295dff137cec09ecf3a05f4fddffd7dfcd1585403449e74198" "checksum digest 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" "checksum dirs 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "13aea89a5c93364a98e9b37b2fa237effbb694d5cfe01c5b70941f7eb087d5e3" "checksum dirs-sys 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "afa0b23de8fd801745c471deffa6e12d248f962c9fd4b4c33787b055599bde7b" -"checksum doc-comment 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "923dea538cea0aa3025e8685b20d6ee21ef99c4f77e954a30febbaac5ec73a97" +"checksum doc-comment 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" "checksum either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "bb1f6b1ce1c140482ea30ddd3335fc0024ac7ee112895426e0a629a6c20adfe3" "checksum encode_unicode 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" "checksum encoding 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)" = "6b0d943856b990d12d3b55b359144ff341533e516d94098b1d3fc1ac666d36ec" @@ -1555,133 +1475,127 @@ dependencies = [ "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 env_logger 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "aafcde04e90a5226a6443b7aabdb016ba2f8307c847d524724bd9b346dd1a2d3" -"checksum error-chain 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3ab49e9dcb602294bc42f9a7dfc9bc6e936fca4418ea300dbfb84fe16de0b7d9" +"checksum error-chain 0.12.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d371106cc88ffdfb1eabd7111e432da544f16f3e2d7bf1dfe8bf575f1df045cd" "checksum escargot 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "74cf96bec282dcdb07099f7e31d9fed323bca9435a09aba7b6d99b7617bca96d" -"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 failure 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "b8529c2421efa3066a5cbd8063d2244603824daccb6936b079010bb2aa89464b" "checksum fake-simd 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" -"checksum flate2 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)" = "2adaffba6388640136149e18ed080b77a78611c1e1d6de75aedcdf78df5d4682" +"checksum flate2 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)" = "2cfff41391129e0a856d6d822600b8d71179d46879e310417eb9c762eb178b42" "checksum fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3" "checksum fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" "checksum fxhash 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" "checksum generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c68f0274ae0e023facc3c97b2e00f076be70e254bc851d972503b328db79b2ec" -"checksum getrandom 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "473a1265acc8ff1e808cd0a1af8cee3c2ee5200916058a2ca113c29f2d903571" -"checksum git2 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "26e07ef27260a78f7e8d218ebac2c72f2c4db50493741b190b6e8eade1da7c68" +"checksum getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "7abc8dd8451921606d809ba32e95b6111925cd2906060d2dcc29c070220503eb" +"checksum git2 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b7da16ceafe24cedd9ba02c4463a2b506b6493baf4317c79c5acb553134a3c15" "checksum glob 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" +"checksum globset 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "7ad1da430bd7281dde2576f44c84cc3f0f7b475e7202cd503042dff01a8c8120" "checksum hermit-abi 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "1010591b26bbfe835e9faeabeb11866061cc7dcebffd56ad7d0942d0e61aefd8" -"checksum humantime 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3ca7e5f2e110db35f93b837c81797f3714500b81d517bf20c431b16d3ca4f114" +"checksum humantime 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "df004cfca50ef23c36850aaaa59ad52cc70d0e90243c3c7737a4dd32dc7a3c4f" "checksum idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e" "checksum idna 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "02e2673c30ee86b5b96a9cb52ad15718aa1f966f5ab9ad54a8b95d5ca33120a9" -"checksum itertools 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5b8467d9c1cebe26feb08c640139247fac215782d35371ade9a2136ed6085358" -"checksum itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "501266b7edd0174f8530248f87f99c88fbe60ca4ef3dd486835b8d8d53136f7f" -"checksum jobserver 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)" = "f2b1d42ef453b30b7387e113da1c83ab1605d90c5b4e0eb8e96d016ed3b8c160" +"checksum itertools 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f56a2d0bc861f9165be4eb3442afd3c236d8a98afd426f65d92324ae1091a484" +"checksum itoa 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "b8b7a7c0c47db5545ed3fef7468ee7bb5b74691498139e4b3f6a20685dc6dd8e" +"checksum jobserver 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)" = "5c71313ebb9439f74b00d9d2dcec36440beaf57a6aa0623068441dd7cd81a7f2" "checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" +"checksum kstring 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6382df53100fd22e149030b6634720c94a151076db8d727b3274d7070975d609" "checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" "checksum lazycell 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b294d6fa9ee409a054354afc4352b0b9ef7ca222c69b8812cbea9e7d2bf3783f" -"checksum libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)" = "34fcd2c08d2f832f376f4173a231990fa5aef4e99fb569867318a227ef4c06ba" -"checksum libgit2-sys 0.11.0+0.99.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4d5d1459353d397a029fb18862166338de938e6be976606bd056cf8f1a912ecf" +"checksum libc 0.2.68 (registry+https://github.com/rust-lang/crates.io-index)" = "dea0c0405123bba743ee3f91f49b1c7cfb684eef0da0a50110f758ccf24cdff0" +"checksum libgit2-sys 0.12.0+0.99.0 (registry+https://github.com/rust-lang/crates.io-index)" = "05dff41ac39e7b653f5f1550886cf00ba52f8e7f57210b633cdeedb3de5b236c" "checksum libloading 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f2b111a074963af1d37a139918ac6d49ad1d0d5e47f72fd55388619691a7d753" "checksum libz-sys 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)" = "2eb5e43362e38e2bca2fd5f5134c4d4564a23a5c28e9b95411652021a8675ebe" "checksum line-wrap 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f30344350a2a51da54c1d53be93fade8a237e545dbcc4bdbe635413f2117cab9" "checksum linked-hash-map 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ae91b68aebc4ddb91978b11a1b02ddd8602a05ec19002801c5666000e05e0f83" -"checksum liquid 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c7cf7f28965f50ff06e2e9f26162f6d944b71f976506a7a01a6308ddebd36155" -"checksum liquid-compiler 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7cd195c00674a2dc811b07969358c97c0639db4a73bc61514db48609d110356f" -"checksum liquid-derive 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5b0faadd0dd1a7cf38390316c36a9a741949462750f9833b794ac6d7de145218" -"checksum liquid-error 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7d5c0851812322e87dcf67c2d7e520c3efd8651bd44eb8d0c0246e6dfb94d481" -"checksum liquid-interpreter 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)" = "998e0411b8cb6210bb0729ccbb15abd2a1c8ef7e318c97511ae5a741c817c63e" -"checksum liquid-value 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e7606ac3743bff9929daff0d0f51f9177ab3ec74520f7f832b8ec595dd96efee" +"checksum liquid 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)" = "62b5a51d24120bc37da30a3bcd741ede7450f00e9fcb0b8648a1d25f7736bc6e" +"checksum liquid-core 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3a922402825d7fd1965364e1d289f909076bcf580e5ae4a5edaf82af1fe7a9dc" +"checksum liquid-derive 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e6fcb48d443dbc49c65b3e5aaecc95e6e911a28b20049d6ac2d94527543fa133" +"checksum liquid-lib 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0629fbd25a919496d2e621e8a3af892bc438273d0f446eb4f0d66ce45117d15d" "checksum log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" "checksum maplit 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d" "checksum matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" -"checksum memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "88579771288728879b57485cc7d6b07d648c9f0141eb955f8ab7f9d45394468e" -"checksum miniz-sys 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "1e9e3ae51cea1576ceba0dde3d484d30e6e5b86dee0b2d412fe3a16a15c98202" -"checksum miniz_oxide 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7108aff85b876d06f22503dcce091e29f76733b2bfdd91eebce81f5e68203a10" -"checksum nodrop 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "2f9667ddcc6cc8a43afc9b7917599d7216aa09c463919ea32c59ed6cac8bc945" +"checksum memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400" +"checksum miniz_oxide 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "aa679ff6578b1cddee93d7e82e263b94a575e0bfced07284eb0c037c1d2416a5" "checksum nom 4.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2ad2a91a8e869eeb30b9cb3119ae87773a8f4ae617f41b1eb9c154b2905f7bd6" -"checksum num-integer 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)" = "b85e541ef8255f6cf42bbfe4ef361305c6c135d10919ecc26126c4e5ae94bc09" -"checksum num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "6ba9a427cfca2be13aa6f6403b0b7e7368fe982bfa16fccc450ce74c46cd9b32" -"checksum num_cpus 1.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "bcef43580c035376c0705c42792c294b66974abbfd2789b511784023f71f3273" +"checksum num-integer 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "3f6ea62e9d81a77cd3ee9a2a5b9b609447857f3d358704331e4ef39eb247fcba" +"checksum num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "c62be47e61d1842b9170f0fdeec8eba98e60e90e5446449a0545e5152acd7096" +"checksum once_cell 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b1c601810575c99596d4afc46f78a678c80105117c379eb3650cf99b8a21ce5b" "checksum onig 5.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e4e723fc996fff1aeab8f62205f3e8528bf498bdd5eadb2784d2d31f30077947" "checksum onig_sys 69.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0a8d4efbf5f59cece01f539305191485b651acb3785b9d5eef05749f0496514e" "checksum opaque-debug 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" "checksum peeking_take_while 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" "checksum percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831" "checksum percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" -"checksum pest 2.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7e4fb201c5c22a55d8b24fef95f78be52738e5e1361129be1b5e862ecdb6894a" +"checksum pest 2.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "10f4872ae94d7b90ae48754df22fd42ad52ce740b8f370b03da4835417403e53" "checksum pest_derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "833d1ae558dc601e9a60366421196a8d94bc0ac980476d0b67e1d0988d72b2d0" -"checksum pest_generator 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7b9fcf299b5712d06ee128a556c94709aaa04512c4dffb8ead07c5c998447fc0" -"checksum pest_meta 2.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "df43fd99896fd72c485fe47542c7b500e4ac1e8700bf995544d1317a60ded547" -"checksum pkg-config 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "a7c1d2cfa5a714db3b5f24f0915e74fcdf91d09d496ba61329705dda7774d2af" +"checksum pest_generator 2.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "99b8db626e31e5b81787b9783425769681b347011cc59471e33ea46d2ea0cf55" +"checksum pest_meta 2.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "54be6e404f5317079812fc8f9f5279de376d8856929e21c184ecf6bbd692a11d" +"checksum pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)" = "05da548ad6865900e60eaba7f589cc0783590a92e940c26953ff81ddbab2d677" "checksum plist 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "5f2a9f075f6394100e7c105ed1af73fb1859d6fd14e49d4290d578120beb167f" -"checksum predicates 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "53e09015b0d3f5a0ec2d4428f7559bb7b3fff341b4e159fedd1d57fac8b939ff" +"checksum predicates 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "347a1b6f0b21e636bc9872fb60b83b8e185f6f5516298b8238699f7f9a531030" "checksum predicates-core 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "06075c3a3e92559ff8929e7a280684489ea27fe44805174c3ebd9328dcb37178" "checksum predicates-tree 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8e63c4859013b38a76eca2414c64911fba30def9e3202ac461a2d22831220124" -"checksum proc-macro-hack 0.5.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e688f31d92ffd7c1ddc57a1b4e6d773c0f2a14ee437a4b0a4f5a69c80eb221c8" +"checksum proc-macro-hack 0.5.14 (registry+https://github.com/rust-lang/crates.io-index)" = "fcfdefadc3d57ca21cf17990a28ef4c0f7c61383a28cb7604cf4a18e6ede1420" "checksum proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)" = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" -"checksum proc-macro2 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "175a40b9cf564ce9bf050654633dbf339978706b8ead1a907bb970b63185dd95" -"checksum proc-quote 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "fa612543f23fda013e1e6ce30b5285a9d313c6e582e57b4ceca74eb5b85685b5" -"checksum proc-quote-impl 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f785f0f8cd00b7945efc3f3bdf8205eb06af5aacec598d83e67f41dc8d101fda" -"checksum quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9274b940887ce9addde99c4eee6b5c44cc494b182b97e73dc8ffdcb3397fd3f0" +"checksum proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)" = "6c09721c6781493a2a492a96b5a5bf19b65917fe6728884e7c44dd0c60ca3435" +"checksum proc-quote 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d8fe0b6f6aef22a400495cdabfd44389b8d5cf71407680fe031be86e51296c85" +"checksum proc-quote-impl 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "66d3ed99337a9586d312fcd7240546abd644b095a5bd1d1809d82c6ae6d16a8c" +"checksum quick-error 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" "checksum quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)" = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" -"checksum quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "053a8c8bcc71fcce321828dc897a98ab9760bef03a4fc36693c231e5b3216cfe" +"checksum quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2bdc6c187c65bca4260c9011c9e3132efe4909da44726bad24cf7572ae338d7f" "checksum rand 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "552840b97013b1a26992c11eac34bdd778e464601a4c2054b5f0bff7c6761293" "checksum rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" "checksum rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" -"checksum rand_os 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "7b75f676a1e053fc562eafbb47838d67c84801e38fc1ba459e8f180deabd5071" "checksum rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" "checksum redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)" = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84" -"checksum redox_users 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4ecedbca3bf205f8d8f5c2b44d83cd0690e39ee84b951ed649e9f1841132b66d" -"checksum regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dc220bd33bdce8f093101afe22a037b8eb0e5af33592e6a9caafff0d4cb81cbd" -"checksum regex-syntax 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)" = "11a7e20d1cce64ef2fed88b66d347f88bd9babb82845b2b858f3edbf59a4f716" +"checksum redox_users 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "09b23093265f8d200fa7b4c2c76297f47e681c655f6f1285a8780d6a022f7431" +"checksum regex 1.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "8900ebc1363efa7ea1c399ccc32daed870b4002651e0bed86e72d501ebbe0048" +"checksum regex-syntax 0.6.17 (registry+https://github.com/rust-lang/crates.io-index)" = "7fe5bd57d1d7414c6b5ed48563a2c855d995ff777729dcd91c369ec7fea395ae" "checksum remove_dir_all 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4a83fa3702a688b9359eccba92d153ac33fd2e8462f9e0e3fdf155239ea7792e" -"checksum rust-argon2 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4ca4eaef519b494d1f2848fc602d18816fed808a981aedf4f1f00ceb7c9d32cf" +"checksum rust-argon2 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2bc8af4bda8e1ff4932523b94d3dd20ee30a87232323eda55903ffd71d2fb017" "checksum rustc-demangle 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783" -"checksum ryu 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c92464b447c0ee8c4fb3824ecc8383b81717b9f1e74ba2e72540aef7b9f82997" -"checksum safemem 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d2b08423011dae9a5ca23f07cf57dac3857f5c885d352b76f6d95f4aea9434d0" -"checksum same-file 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "585e8ddcedc187886a30fa705c47985c3fa88d06624095856b36ca0b82ff4421" -"checksum serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)" = "fec2851eb56d010dc9a21b89ca53ee75e6528bab60c11e89d38390904982da9f" -"checksum serde_derive 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)" = "cb4dc18c61206b08dc98216c98faa0232f4337e1e1b8574551d5bad29ea1b425" -"checksum serde_json 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)" = "051c49229f282f7c6f3813f8286cc1e3323e8051823fce42c7ea80fe13521704" -"checksum sha-1 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "23962131a91661d643c98940b20fcaffe62d776a823247be80a48fcb8b6fce68" +"checksum ryu 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "535622e6be132bccd223f4bb2b8ac8d53cda3c7a6394944d3b2b33fb974f9d76" +"checksum safemem 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ef703b7cb59335eae2eb93ceb664c0eb7ea6bf567079d843e09420219668e072" +"checksum same-file 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +"checksum serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)" = "e707fbbf255b8fc8c3b99abb91e7257a622caeb20a9818cbadbeeede4e0932ff" +"checksum serde_derive 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)" = "ac5d00fc561ba2724df6758a17de23df5914f20e41cb00f94d5b7ae42fffaff8" +"checksum serde_json 1.0.48 (registry+https://github.com/rust-lang/crates.io-index)" = "9371ade75d4c2d6cb154141b9752cf3781ec9c05e0e5cf35060e1e70ee7b9c25" +"checksum sha-1 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f7d94d0bede923b3cea61f3f1ff57ff8cdfd77b400fb8f9998949e0cf04163df" "checksum shell-words 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "39acde55a154c4cd3ae048ac78cc21c25f3a0145e44111b523279113dce0d94a" "checksum shlex 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7fdf1b9db47230893d76faad238fd6097fd6d6a9245cd7a4d90dbd639536bbd2" -"checksum smallvec 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)" = "ab606a9c5e214920bb66c458cd7be8ef094f813f20fe77a54cc7dbfff220d4b7" +"checksum smallvec 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5c2fb2ec9bcd216a5b0d0ccf31ab17b5ed1d627960edff65bbe95d3ce221cefc" "checksum strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" -"checksum syn 0.15.44 (registry+https://github.com/rust-lang/crates.io-index)" = "9ca4b3b69a77cbe1ffc9e198781b7acb0c7365a883670e8f1c1bc66fba79a5c5" -"checksum syn 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "66850e97125af79138385e9b88339cbcd037e3f28ceab8c5ad98e64f0f1f80bf" -"checksum synstructure 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)" = "02353edf96d6e4dc81aea2d8490a7e9db177bf8acb0e951c24940bf866cb313f" +"checksum syn 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)" = "0df0eb663f387145cab623dea85b09c2c5b4b0aef44e945d928e682fce71bb03" "checksum syntect 3.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "955e9da2455eea5635f7032fc3a229908e6af18c39600313866095e07db0d8b8" "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 termcolor 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "96d6098003bde162e4277c70665bd87c326f5a0c3f3fbfb285787fa482d54e6e" +"checksum termcolor 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bb6bfa289a4d7c5766392812c0a1f4c1ba45afa1ad47803c11e1f407d846d75f" "checksum termios 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "72b620c5ea021d75a735c943269bb07d30c9b77d6ac6b236bc8b5c496ef05625" "checksum textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" -"checksum thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c6b53e329000edc2b34dbe8545fd20e55a333362d0a321909685a19bd28c3f1b" +"checksum thread_local 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d40c6d1b69745a6ec6fb1ca717914848da4b44ae29d9b3080cbee91d72a69b14" "checksum time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "db8dcfca086c1143c9270ac42a2bbd8a7ee477b78ac8e45b19abfb0cbede4b6f" "checksum treeline 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a7f741b240f1a48843f9b8e0444fb55fb2a4ff67293b50a9179dfd5ea67f8d41" "checksum typenum 1.11.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6d2783fe2d6b8c1101136184eb41be8b1ad379e4657050b8aaff0c79ee7575f9" -"checksum ucd-trie 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "8f00ed7be0c1ff1e24f46c3d2af4859f7e863672ba3a6e92e7cff702bf9f06c2" +"checksum ucd-trie 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "56dee185309b50d1f11bfedef0fe6d036842e3fb77413abef29f8f8d1c5d4c1c" "checksum unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" -"checksum unicode-normalization 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "141339a08b982d942be2ca06ff8b076563cbe223d1befd5450716790d44e2426" -"checksum unicode-segmentation 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1967f4cdfc355b37fd76d2a954fb2ed3871034eb4f26d60537d88795cfc332a9" +"checksum unicode-normalization 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "5479532badd04e128284890390c1e876ef7a993d0570b3597ae43dfa1d59afa4" +"checksum unicode-segmentation 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e83e153d1053cbb5a118eeff7fd5be06ed99153f00dbcd8ae310c5fb2b22edc0" "checksum unicode-width 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "caaa9d531767d1ff2150b9332433f32a24622147e5ebb1f26409d5da67afd479" "checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" "checksum unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" "checksum url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dd4e7c0d531266369519a4aa4f399d748bd37043b00bde1e4ff1f60a120b355a" -"checksum url 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "75b414f6c464c879d7f9babf951f23bc3743fb7313c081b2e6ca719067ea9d61" -"checksum vcpkg 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "33dd455d0f96e90a75803cfeb7f948768c08d70a6de9a8d2362461935698bf95" +"checksum url 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "829d4a8476c35c9bf0bbce5a3b23f4106f79728039b726d292bb93bc106787cb" +"checksum vcpkg 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "3fc439f2794e98976c88a2a2dafce96b930fe8010b0a256b3c2199a773933168" "checksum vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05c78687fb1a80548ae3250346c3db86a80a7cdd77bda190189f2d0a0987c81a" "checksum version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd" -"checksum walkdir 2.2.9 (registry+https://github.com/rust-lang/crates.io-index)" = "9658c94fa8b940eab2250bd5a457f9c48b748420d71293b165c8cdbe2f55f71e" -"checksum wasi 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b89c3ce4ce14bdc6fb6beaf9ec7928ca331de5df7e5ea278375642a2f478570d" +"checksum version_check 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "078775d0255232fb988e6fccf26ddc9d1ac274299aaedcedce21c6f72cc533ce" +"checksum walkdir 2.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "777182bc735b6424e1a57516d35ed72cb8019d85c8c9bf536dccb3445c1a2f7d" +"checksum wasi 0.9.0+wasi-snapshot-preview1 (registry+https://github.com/rust-lang/crates.io-index)" = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" "checksum which 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b57acb10231b9493c8472b20cb57317d0679a49e0bdbee44b3b803a6473af164" "checksum wild 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "97d34fecce28871e5c0e059deae21ef7f7d13b98a5964b24c58b3735c8052fc8" "checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" "checksum winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" "checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" "checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" -"checksum winapi-util 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7168bab6e1daee33b4557efd0e95d5ca70a03706d39fa5f3fe7a236f584b03c9" +"checksum winapi-util 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "4ccfbf554c6ad11084fb7517daca16cfdcaccbdadba4fc336f032a8b12c2ad80" "checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" -"checksum wincolor 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "96f5016b18804d24db43cebf3c77269e7569b8954a8464501c216cc5e070eaa9" "checksum xml-rs 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "541b12c998c5b56aa2b4e6f18f03664eef9a4fd0a246a55594efae6cc2d964b5" "checksum yaml-rust 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "65923dd1784f44da1d2c3dbbc5e822045628c590ba72123e1c73d3c230c4434d" diff --git a/Cargo.toml b/Cargo.toml index 149bd3d1..60b2d4e1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,7 +7,7 @@ license = "MIT/Apache-2.0" name = "bat" readme = "README.md" repository = "https://github.com/sharkdp/bat" -version = "0.12.1" +version = "0.13.0" exclude = [ "assets/syntaxes/*", "assets/themes/*", @@ -27,9 +27,10 @@ content_inspector = "0.2.4" encoding = "0.2" shell-words = "0.1.0" unicode-width = "0.1.7" +globset = "0.4" [dependencies.git2] -version = "0.12" +version = "0.13" default-features = false features = [] @@ -54,7 +55,7 @@ assert_cmd = "0.12.0" [build-dependencies] clap = "2.33" -liquid = "0.19" +liquid = "0.20" lazy_static = "1.4" [profile.release] diff --git a/README.md b/README.md index db80f69e..b58dc2be 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ InstallationCustomizationProject goals, alternatives • - Translation [中文][日本語] + Translation [中文][日本語][한국어]

### Syntax highlighting @@ -180,7 +180,7 @@ apt install bat If you want to run the latest release of bat or if you are on older versions of Ubuntu/Debian, download the latest `.deb` package from the [release page](https://github.com/sharkdp/bat/releases) and install it via: ```bash -sudo dpkg -i bat_0.12.1_amd64.deb # adapt version number and architecture +sudo dpkg -i bat_0.13.0_amd64.deb # adapt version number and architecture ``` ### On Alpine Linux @@ -341,7 +341,7 @@ binaries are also available: look for archives with `musl` in the file name. ### From source -If you want to build `bat` from source, you need Rust 1.36 or +If you want to build `bat` from source, you need Rust 1.37 or higher. You can then use `cargo` to build everything: ```bash @@ -500,11 +500,11 @@ Example configuration file: # Use italic text on the terminal (not supported on all terminals) --italic-text=always -# Use C++ syntax (instead of C) for .h header files ---map-syntax h:cpp +# Use C++ syntax for .ino files +--map-syntax "*.ino:C++" -# Use "gitignore" highlighting for ".ignore" files ---map-syntax .ignore:.gitignore +# Use ".gitignore"-style highlighting for ".ignore" files +--map-syntax ".ignore:Git Ignore" ``` ## Using `bat` on Windows diff --git a/assets/JavaDoc.sublime-syntax.patch b/assets/JavaDoc.sublime-syntax.patch index 731a75a7..62ee742e 100644 --- a/assets/JavaDoc.sublime-syntax.patch +++ b/assets/JavaDoc.sublime-syntax.patch @@ -1,7 +1,7 @@ -diff --git syntaxes/Packages/Java/JavaDoc.sublime-syntax syntaxes/Packages/Java/JavaDoc.sublime-syntax +diff --git syntaxes/01_Packages/Java/JavaDoc.sublime-syntax syntaxes/01_Packages/Java/JavaDoc.sublime-syntax index 422a6a9..40a741e 100644 ---- syntaxes/Packages/Java/JavaDoc.sublime-syntax -+++ syntaxes/Packages/Java/JavaDoc.sublime-syntax +--- syntaxes/01_Packages/Java/JavaDoc.sublime-syntax ++++ syntaxes/01_Packages/Java/JavaDoc.sublime-syntax @@ -13,7 +13,7 @@ variables: contexts: prototype: diff --git a/assets/create.sh b/assets/create.sh index 0ebd1dcd..3fb63ebf 100755 --- a/assets/create.sh +++ b/assets/create.sh @@ -44,7 +44,7 @@ bat cache --clear # TODO: Remove this (and the reverse part below) when # https://github.com/trishume/syntect/issues/222 has been fixed -JAVADOC_FILE="${ASSET_DIR}/syntaxes/Packages/Java/JavaDoc.sublime-syntax" +JAVADOC_FILE="${ASSET_DIR}/syntaxes/01_Packages/Java/JavaDoc.sublime-syntax" JAVADOC_PATCH="${ASSET_DIR}/JavaDoc.sublime-syntax.patch" patch "$JAVADOC_FILE" "$JAVADOC_PATCH" diff --git a/assets/manual/bat.1.in b/assets/manual/bat.1.in index e813e038..6345bde5 100644 --- a/assets/manual/bat.1.in +++ b/assets/manual/bat.1.in @@ -1,18 +1,23 @@ .TH {{PROJECT_EXECUTABLE | upcase}} "1" .SH NAME -{{PROJECT_EXECUTABLE}} \- manual page for {{PROJECT_NAME}} -.SH DESCRIPTION -{{PROJECT_EXECUTABLE}} - a cat(1) clone with syntax highlighting and Git integration. +{{PROJECT_EXECUTABLE}} \- a cat(1) clone with syntax highlighting and Git integration. .SH "USAGE" -.IP -{{PROJECT_EXECUTABLE}} [OPTIONS] [FILE]... -.IP -{{PROJECT_EXECUTABLE}} +.IP "{{PROJECT_EXECUTABLE}} [OPTIONS] [FILE]..." +.IP "{{PROJECT_EXECUTABLE}} cache [CACHE-OPTIONS] [--build|--clear] +.SH DESCRIPTION +{{PROJECT_EXECUTABLE}} prints the syntax-highlighted content of a collection of FILEs to the +terminal. If no FILE is specified, or when FILE is '-', it reads from standard input. + +{{PROJECT_EXECUTABLE}} supports a large number of programming and markup languages. +It also communicates with git(1) to show modifications with respect to the git index. +{{PROJECT_EXECUTABLE}} automatically pipes its output through a pager (by default: less). + +Whenever the output of {{PROJECT_EXECUTABLE}} goes to a non-interactive terminal, i.e. when the +output is piped into another process or into a file, {{PROJECT_EXECUTABLE}} will act as a drop-in +replacement for cat(1) and fall back to printing the plain file contents. + .SH "OPTIONS" -.HP -General remarks -.IP -Command-line options like '-l'/'--language' that take values can be specified as +General remarks: Command-line options like '-l'/'--language' that take values can be specified as either '--language value', '--language=value', '-l value' or '-lvalue'. .HP \fB\-A\fR, \fB\-\-show\-all\fR @@ -33,78 +38,80 @@ specified as a name (like 'C++' or 'LaTeX') or possible file extension (like 'cpp', 'hpp' or 'md'). Use '\-\-list\-languages' to show all supported language names and file extensions. .HP -\fB\-H\fR, \fB\-\-highlight\-line\fR ... +\fB\-H\fR, \fB\-\-highlight\-line\fR ... .IP -Highlight the N\-th line with a different background color +Highlight the specified line ranges with a different background color For example: +.RS +.IP "\-\-highlight\-line 40" +highlights line 40 +.IP "\-\-highlight\-line 30:40" +highlights lines 30 to 40 +.IP "\-\-highlight\-line :40" +highlights lines 1 to 40 +.IP "\-\-highlight\-line 40:" +highlights lines 40 to the end of the file +.RE .HP \fB\-\-tabs\fR .IP -Set the tab width to T spaces. Use a width of 0 to pass tabs through -directly +Set the tab width to T spaces. Use a width of 0 to pass tabs through directly .HP \fB\-\-wrap\fR .IP -Specify the text\-wrapping mode (*auto*, never, character). The -\&'\-\-terminal\-width' option can be used in addition to control the output -width. +Specify the text\-wrapping mode (*auto*, never, character). The '\-\-terminal\-width' option +can be used in addition to control the output width. .HP \fB\-\-terminal\-width\fR .IP -Explicitly set the width of the terminal instead of determining it -automatically. If prefixed with '+' or '\-', the value will be treated as -an offset to the actual terminal width. See also: '\-\-wrap'. +Explicitly set the width of the terminal instead of determining it automatically. If +prefixed with '+' or '\-', the value will be treated as an offset to the actual terminal +width. See also: '\-\-wrap'. .HP \fB\-n\fR, \fB\-\-number\fR .IP -Only show line numbers, no other decorations. This is an alias for -\&'\-\-style=numbers' +Only show line numbers, no other decorations. This is an alias for '\-\-style=numbers' .HP \fB\-\-color\fR .IP -Specify when to use colored output. The automatic mode only enables colors -if an interactive terminal is detected. Possible values: *auto*, never, -always. +Specify when to use colored output. The automatic mode only enables colors if an +interactive terminal is detected. Possible values: *auto*, never, always. .HP \fB\-\-italic\-text\fR .IP -Specify when to use ANSI sequences for italic text in the output. Possible -values: always, *never*. +Specify when to use ANSI sequences for italic text in the output. Possible values: +always, *never*. .HP \fB\-\-decorations\fR .IP -Specify when to use the decorations that have been specified via -\&'\-\-style'. The automatic mode only enables decorations if an interactive -terminal is detected. Possible values: *auto*, never, always. +Specify when to use the decorations that have been specified via '\-\-style'. The +automatic mode only enables decorations if an interactive terminal is detected. Possible +values: *auto*, never, always. .HP \fB\-\-paging\fR .IP -Specify when to use the pager. To control which pager is used, set the -PAGER or BAT_PAGER environment variables (the latter takes precedence) or -use the '\-\-pager' option. To disable the pager permanently, set BAT_PAGER -to an empty string or set '\-\-paging=never' in the configuration file. -Possible values: *auto*, never, always. +Specify when to use the pager. To control which pager is used, set the PAGER or +BAT_PAGER environment variables (the latter takes precedence) or use the '\-\-pager' +option. To disable the pager permanently, set BAT_PAGER to an empty string or set +\&'\-\-paging=never' in the configuration file. Possible values: *auto*, never, always. .HP \fB\-\-pager\fR .IP -Determine which pager is used. This option will overwrite the PAGER and -BAT_PAGER environment variables. The default pager is 'less'. To disable -the pager completely, use the '\-\-paging' option. Example: '\-\-pager "less -\fB\-RF\fR"'. +Determine which pager is used. This option will overwrite the PAGER and BAT_PAGER +environment variables. The default pager is 'less'. To disable the pager completely, use +the '\-\-paging' option. Example: '\-\-pager "less \fB\-RF\fR"'. .HP -\fB\-m\fR, \fB\-\-map\-syntax\fR ... +\fB\-m\fR, \fB\-\-map\-syntax\fR ... .IP -Map a file extension or file name to an existing syntax (specified by a -file extension or file name). For example, to -highlight *.build files with the Python syntax, use '\-m build:py'. To -highlight files named '.myignore' with the Git Ignore syntax, use '\-m -\&.myignore:gitignore'. +Map a glob pattern to an existing syntax name. The glob pattern is matched on the full +path and the filename. For example, to highlight *.build files with the Python syntax, +use -m '*.build:Python'. To highlight files named '.myignore' with the Git Ignore +syntax, use -m '.myignore:Git Ignore'. .HP \fB\-\-theme\fR .IP -Set the theme for syntax highlighting. Use '\-\-list\-themes' to see all -available themes. To set a default theme, add the '\-\-theme="..."' option -to the configuration file or export the BAT_THEME environment variable -(e.g.: export BAT_THEME="..."). +Set the theme for syntax highlighting. Use '\-\-list\-themes' to see all available themes. +To set a default theme, add the '\-\-theme="..."' option to the configuration file or +export the BAT_THEME environment variable (e.g.: export BAT_THEME="..."). .HP \fB\-\-list\-themes\fR .IP @@ -112,12 +119,11 @@ Display a list of supported themes for syntax highlighting. .HP \fB\-\-style\fR .IP -Configure which elements (line numbers, file headers, grid borders, Git -modifications, ..) to display in addition to the file contents. The -argument is a comma\-separated list of components to display (e.g. -\&'numbers,changes,grid') or a pre\-defined style ('full'). To set a default -style, add the '\-\-style=".."' option to the configuration file or export -the BAT_STYLE environment variable (e.g.: export BAT_STYLE=".."). Possible +Configure which elements (line numbers, file headers, grid borders, Git modifications, +\&..) to display in addition to the file contents. The argument is a comma\-separated list +of components to display (e.g. 'numbers,changes,grid') or a pre\-defined style ('full'). +To set a default style, add the '\-\-style=".."' option to the configuration file or +export the BAT_STYLE environment variable (e.g.: export BAT_STYLE=".."). Possible values: *auto*, full, plain, changes, header, grid, numbers, snip. .HP \fB\-r\fR, \fB\-\-line\-range\fR ... @@ -138,8 +144,8 @@ Display a list of supported languages for syntax highlighting. .HP \fB\-u\fR, \fB\-\-unbuffered\fR .IP -This option exists for POSIX\-compliance reasons ('u' is for 'unbuffered'). -The output is always unbuffered \- this option is simply ignored. +This option exists for POSIX\-compliance reasons ('u' is for 'unbuffered'). The output is +always unbuffered \- this option is simply ignored. .HP \fB\-h\fR, \fB\-\-help\fR .IP @@ -148,13 +154,20 @@ Print this help message. \fB\-V\fR, \fB\-\-version\fR .IP Show version information. -.SH "ARGS" +.SH "POSITIONAL ARGUMENTS" +.HP +\fB...\fR .IP -... -.IP -File(s) to print / concatenate. Use a dash ('\-') or no argument at all to read -from standard input. +Files to print and concatenate. Use a dash ('\-') or no argument at all to read from +standard input. .SH "SUBCOMMANDS" -.IP -cache -Modify the syntax\-definition and theme cache +.HP +\fBcache\fR - Modify the syntax\-definition and theme cache. +.SH "FILES" +{{PROJECT_EXECUTABLE}} 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: + +\fB{{PROJECT_EXECUTABLE}} --config-file\fR + +Alternatively, you can use the BAT_CONFIG_PATH environment variable to point bat to a non-default +location of the configuration file. diff --git a/assets/syntaxes.bin b/assets/syntaxes.bin index 82569b61..a412e5e3 100644 Binary files a/assets/syntaxes.bin and b/assets/syntaxes.bin differ diff --git a/assets/syntaxes/Packages b/assets/syntaxes/01_Packages similarity index 100% rename from assets/syntaxes/Packages rename to assets/syntaxes/01_Packages diff --git a/assets/syntaxes/AWK b/assets/syntaxes/02_Extra/AWK similarity index 100% rename from assets/syntaxes/AWK rename to assets/syntaxes/02_Extra/AWK diff --git a/assets/syntaxes/AsciiDoc b/assets/syntaxes/02_Extra/AsciiDoc similarity index 100% rename from assets/syntaxes/AsciiDoc rename to assets/syntaxes/02_Extra/AsciiDoc diff --git a/assets/syntaxes/AsciiDoc.sublime-syntax b/assets/syntaxes/02_Extra/AsciiDoc.sublime-syntax similarity index 100% rename from assets/syntaxes/AsciiDoc.sublime-syntax rename to assets/syntaxes/02_Extra/AsciiDoc.sublime-syntax diff --git a/assets/syntaxes/Assembly (ARM) b/assets/syntaxes/02_Extra/Assembly (ARM) similarity index 100% rename from assets/syntaxes/Assembly (ARM) rename to assets/syntaxes/02_Extra/Assembly (ARM) diff --git a/assets/syntaxes/Assembly (ARM).sublime-syntax b/assets/syntaxes/02_Extra/Assembly (ARM).sublime-syntax similarity index 100% rename from assets/syntaxes/Assembly (ARM).sublime-syntax rename to assets/syntaxes/02_Extra/Assembly (ARM).sublime-syntax diff --git a/assets/syntaxes/Assembly (x86_64).sublime-syntax b/assets/syntaxes/02_Extra/Assembly (x86_64).sublime-syntax similarity index 100% rename from assets/syntaxes/Assembly (x86_64).sublime-syntax rename to assets/syntaxes/02_Extra/Assembly (x86_64).sublime-syntax diff --git a/assets/syntaxes/CMake b/assets/syntaxes/02_Extra/CMake similarity index 100% rename from assets/syntaxes/CMake rename to assets/syntaxes/02_Extra/CMake diff --git a/assets/syntaxes/CSV b/assets/syntaxes/02_Extra/CSV similarity index 100% rename from assets/syntaxes/CSV rename to assets/syntaxes/02_Extra/CSV diff --git a/assets/syntaxes/CSV.sublime-syntax b/assets/syntaxes/02_Extra/CSV.sublime-syntax similarity index 100% rename from assets/syntaxes/CSV.sublime-syntax rename to assets/syntaxes/02_Extra/CSV.sublime-syntax diff --git a/assets/syntaxes/Cabal b/assets/syntaxes/02_Extra/Cabal similarity index 100% rename from assets/syntaxes/Cabal rename to assets/syntaxes/02_Extra/Cabal diff --git a/assets/syntaxes/Cabal.sublime-syntax b/assets/syntaxes/02_Extra/Cabal.sublime-syntax similarity index 100% rename from assets/syntaxes/Cabal.sublime-syntax rename to assets/syntaxes/02_Extra/Cabal.sublime-syntax diff --git a/assets/syntaxes/CoffeeScript b/assets/syntaxes/02_Extra/CoffeeScript similarity index 100% rename from assets/syntaxes/CoffeeScript rename to assets/syntaxes/02_Extra/CoffeeScript diff --git a/assets/syntaxes/CoffeeScript.sublime-syntax b/assets/syntaxes/02_Extra/CoffeeScript.sublime-syntax similarity index 100% rename from assets/syntaxes/CoffeeScript.sublime-syntax rename to assets/syntaxes/02_Extra/CoffeeScript.sublime-syntax diff --git a/assets/syntaxes/CpuInfo.sublime-syntax b/assets/syntaxes/02_Extra/CpuInfo.sublime-syntax similarity index 100% rename from assets/syntaxes/CpuInfo.sublime-syntax rename to assets/syntaxes/02_Extra/CpuInfo.sublime-syntax diff --git a/assets/syntaxes/Crystal b/assets/syntaxes/02_Extra/Crystal similarity index 100% rename from assets/syntaxes/Crystal rename to assets/syntaxes/02_Extra/Crystal diff --git a/assets/syntaxes/Crystal.sublime-syntax b/assets/syntaxes/02_Extra/Crystal.sublime-syntax similarity index 100% rename from assets/syntaxes/Crystal.sublime-syntax rename to assets/syntaxes/02_Extra/Crystal.sublime-syntax diff --git a/assets/syntaxes/Dart b/assets/syntaxes/02_Extra/Dart similarity index 100% rename from assets/syntaxes/Dart rename to assets/syntaxes/02_Extra/Dart diff --git a/assets/syntaxes/Dart.sublime-syntax b/assets/syntaxes/02_Extra/Dart.sublime-syntax similarity index 100% rename from assets/syntaxes/Dart.sublime-syntax rename to assets/syntaxes/02_Extra/Dart.sublime-syntax diff --git a/assets/syntaxes/Docker b/assets/syntaxes/02_Extra/Docker similarity index 100% rename from assets/syntaxes/Docker rename to assets/syntaxes/02_Extra/Docker diff --git a/assets/syntaxes/DotENV b/assets/syntaxes/02_Extra/DotENV similarity index 100% rename from assets/syntaxes/DotENV rename to assets/syntaxes/02_Extra/DotENV diff --git a/assets/syntaxes/DotENV.sublime-syntax b/assets/syntaxes/02_Extra/DotENV.sublime-syntax similarity index 100% rename from assets/syntaxes/DotENV.sublime-syntax rename to assets/syntaxes/02_Extra/DotENV.sublime-syntax diff --git a/assets/syntaxes/Elixir b/assets/syntaxes/02_Extra/Elixir similarity index 100% rename from assets/syntaxes/Elixir rename to assets/syntaxes/02_Extra/Elixir diff --git a/assets/syntaxes/Elm b/assets/syntaxes/02_Extra/Elm similarity index 100% rename from assets/syntaxes/Elm rename to assets/syntaxes/02_Extra/Elm diff --git a/assets/syntaxes/FSharp b/assets/syntaxes/02_Extra/FSharp similarity index 100% rename from assets/syntaxes/FSharp rename to assets/syntaxes/02_Extra/FSharp diff --git a/assets/syntaxes/Fish b/assets/syntaxes/02_Extra/Fish similarity index 100% rename from assets/syntaxes/Fish rename to assets/syntaxes/02_Extra/Fish diff --git a/assets/syntaxes/Fstab.sublime-syntax b/assets/syntaxes/02_Extra/Fstab.sublime-syntax similarity index 100% rename from assets/syntaxes/Fstab.sublime-syntax rename to assets/syntaxes/02_Extra/Fstab.sublime-syntax diff --git a/assets/syntaxes/GraphQL b/assets/syntaxes/02_Extra/GraphQL similarity index 100% rename from assets/syntaxes/GraphQL rename to assets/syntaxes/02_Extra/GraphQL diff --git a/assets/syntaxes/Group.sublime-syntax b/assets/syntaxes/02_Extra/Group.sublime-syntax similarity index 100% rename from assets/syntaxes/Group.sublime-syntax rename to assets/syntaxes/02_Extra/Group.sublime-syntax diff --git a/assets/syntaxes/HTML (Twig) b/assets/syntaxes/02_Extra/HTML (Twig) similarity index 100% rename from assets/syntaxes/HTML (Twig) rename to assets/syntaxes/02_Extra/HTML (Twig) diff --git a/assets/syntaxes/HTML (Twig).sublime-syntax b/assets/syntaxes/02_Extra/HTML (Twig).sublime-syntax similarity index 100% rename from assets/syntaxes/HTML (Twig).sublime-syntax rename to assets/syntaxes/02_Extra/HTML (Twig).sublime-syntax diff --git a/assets/syntaxes/Hosts.sublime-syntax b/assets/syntaxes/02_Extra/Hosts.sublime-syntax similarity index 100% rename from assets/syntaxes/Hosts.sublime-syntax rename to assets/syntaxes/02_Extra/Hosts.sublime-syntax diff --git a/assets/syntaxes/INI b/assets/syntaxes/02_Extra/INI similarity index 100% rename from assets/syntaxes/INI rename to assets/syntaxes/02_Extra/INI diff --git a/assets/syntaxes/INI.sublime-syntax b/assets/syntaxes/02_Extra/INI.sublime-syntax similarity index 100% rename from assets/syntaxes/INI.sublime-syntax rename to assets/syntaxes/02_Extra/INI.sublime-syntax diff --git a/assets/syntaxes/JavaScript (Babel) b/assets/syntaxes/02_Extra/JavaScript (Babel) similarity index 100% rename from assets/syntaxes/JavaScript (Babel) rename to assets/syntaxes/02_Extra/JavaScript (Babel) diff --git a/assets/syntaxes/JavaScript (Babel).sublime-syntax b/assets/syntaxes/02_Extra/JavaScript (Babel).sublime-syntax similarity index 100% rename from assets/syntaxes/JavaScript (Babel).sublime-syntax rename to assets/syntaxes/02_Extra/JavaScript (Babel).sublime-syntax diff --git a/assets/syntaxes/Jinja2 b/assets/syntaxes/02_Extra/Jinja2 similarity index 100% rename from assets/syntaxes/Jinja2 rename to assets/syntaxes/02_Extra/Jinja2 diff --git a/assets/syntaxes/Jsonnet b/assets/syntaxes/02_Extra/Jsonnet similarity index 100% rename from assets/syntaxes/Jsonnet rename to assets/syntaxes/02_Extra/Jsonnet diff --git a/assets/syntaxes/Julia b/assets/syntaxes/02_Extra/Julia similarity index 100% rename from assets/syntaxes/Julia rename to assets/syntaxes/02_Extra/Julia diff --git a/assets/syntaxes/Kotlin b/assets/syntaxes/02_Extra/Kotlin similarity index 100% rename from assets/syntaxes/Kotlin rename to assets/syntaxes/02_Extra/Kotlin diff --git a/assets/syntaxes/Kotlin.sublime-syntax b/assets/syntaxes/02_Extra/Kotlin.sublime-syntax similarity index 100% rename from assets/syntaxes/Kotlin.sublime-syntax rename to assets/syntaxes/02_Extra/Kotlin.sublime-syntax diff --git a/assets/syntaxes/LESS b/assets/syntaxes/02_Extra/LESS similarity index 100% rename from assets/syntaxes/LESS rename to assets/syntaxes/02_Extra/LESS diff --git a/assets/syntaxes/Manpage.sublime-syntax b/assets/syntaxes/02_Extra/Manpage.sublime-syntax similarity index 100% rename from assets/syntaxes/Manpage.sublime-syntax rename to assets/syntaxes/02_Extra/Manpage.sublime-syntax diff --git a/assets/syntaxes/MemInfo.sublime-syntax b/assets/syntaxes/02_Extra/MemInfo.sublime-syntax similarity index 100% rename from assets/syntaxes/MemInfo.sublime-syntax rename to assets/syntaxes/02_Extra/MemInfo.sublime-syntax diff --git a/assets/syntaxes/Nim.sublime-syntax b/assets/syntaxes/02_Extra/Nim.sublime-syntax similarity index 100% rename from assets/syntaxes/Nim.sublime-syntax rename to assets/syntaxes/02_Extra/Nim.sublime-syntax diff --git a/assets/syntaxes/Nix b/assets/syntaxes/02_Extra/Nix similarity index 100% rename from assets/syntaxes/Nix rename to assets/syntaxes/02_Extra/Nix diff --git a/assets/syntaxes/Nix.sublime-syntax b/assets/syntaxes/02_Extra/Nix.sublime-syntax similarity index 100% rename from assets/syntaxes/Nix.sublime-syntax rename to assets/syntaxes/02_Extra/Nix.sublime-syntax diff --git a/assets/syntaxes/Org mode b/assets/syntaxes/02_Extra/Org mode similarity index 100% rename from assets/syntaxes/Org mode rename to assets/syntaxes/02_Extra/Org mode diff --git a/assets/syntaxes/Org mode.sublime-syntax b/assets/syntaxes/02_Extra/Org mode.sublime-syntax similarity index 100% rename from assets/syntaxes/Org mode.sublime-syntax rename to assets/syntaxes/02_Extra/Org mode.sublime-syntax diff --git a/assets/syntaxes/Passwd.sublime-syntax b/assets/syntaxes/02_Extra/Passwd.sublime-syntax similarity index 100% rename from assets/syntaxes/Passwd.sublime-syntax rename to assets/syntaxes/02_Extra/Passwd.sublime-syntax diff --git a/assets/syntaxes/PowerShell b/assets/syntaxes/02_Extra/PowerShell similarity index 100% rename from assets/syntaxes/PowerShell rename to assets/syntaxes/02_Extra/PowerShell diff --git a/assets/syntaxes/PowerShell.sublime-syntax b/assets/syntaxes/02_Extra/PowerShell.sublime-syntax similarity index 100% rename from assets/syntaxes/PowerShell.sublime-syntax rename to assets/syntaxes/02_Extra/PowerShell.sublime-syntax diff --git a/assets/syntaxes/Protobuf b/assets/syntaxes/02_Extra/Protobuf similarity index 100% rename from assets/syntaxes/Protobuf rename to assets/syntaxes/02_Extra/Protobuf diff --git a/assets/syntaxes/Puppet b/assets/syntaxes/02_Extra/Puppet similarity index 100% rename from assets/syntaxes/Puppet rename to assets/syntaxes/02_Extra/Puppet diff --git a/assets/syntaxes/PureScript b/assets/syntaxes/02_Extra/PureScript similarity index 100% rename from assets/syntaxes/PureScript rename to assets/syntaxes/02_Extra/PureScript diff --git a/assets/syntaxes/Resolv.sublime-syntax b/assets/syntaxes/02_Extra/Resolv.sublime-syntax similarity index 100% rename from assets/syntaxes/Resolv.sublime-syntax rename to assets/syntaxes/02_Extra/Resolv.sublime-syntax diff --git a/assets/syntaxes/Robot b/assets/syntaxes/02_Extra/Robot similarity index 100% rename from assets/syntaxes/Robot rename to assets/syntaxes/02_Extra/Robot diff --git a/assets/syntaxes/Robot.sublime-syntax b/assets/syntaxes/02_Extra/Robot.sublime-syntax similarity index 100% rename from assets/syntaxes/Robot.sublime-syntax rename to assets/syntaxes/02_Extra/Robot.sublime-syntax diff --git a/assets/syntaxes/SCSS_Sass b/assets/syntaxes/02_Extra/SCSS_Sass similarity index 100% rename from assets/syntaxes/SCSS_Sass rename to assets/syntaxes/02_Extra/SCSS_Sass diff --git a/assets/syntaxes/SLS b/assets/syntaxes/02_Extra/SLS similarity index 100% rename from assets/syntaxes/SLS rename to assets/syntaxes/02_Extra/SLS diff --git a/assets/syntaxes/Strace b/assets/syntaxes/02_Extra/Strace similarity index 100% rename from assets/syntaxes/Strace rename to assets/syntaxes/02_Extra/Strace diff --git a/assets/syntaxes/Swift b/assets/syntaxes/02_Extra/Swift similarity index 100% rename from assets/syntaxes/Swift rename to assets/syntaxes/02_Extra/Swift diff --git a/assets/syntaxes/Swift.sublime-syntax b/assets/syntaxes/02_Extra/Swift.sublime-syntax similarity index 100% rename from assets/syntaxes/Swift.sublime-syntax rename to assets/syntaxes/02_Extra/Swift.sublime-syntax diff --git a/assets/syntaxes/Syslog b/assets/syntaxes/02_Extra/Syslog similarity index 100% rename from assets/syntaxes/Syslog rename to assets/syntaxes/02_Extra/Syslog diff --git a/assets/syntaxes/TOML b/assets/syntaxes/02_Extra/TOML similarity index 100% rename from assets/syntaxes/TOML rename to assets/syntaxes/02_Extra/TOML diff --git a/assets/syntaxes/Terraform b/assets/syntaxes/02_Extra/Terraform similarity index 100% rename from assets/syntaxes/Terraform rename to assets/syntaxes/02_Extra/Terraform diff --git a/assets/syntaxes/TypeScript b/assets/syntaxes/02_Extra/TypeScript similarity index 100% rename from assets/syntaxes/TypeScript rename to assets/syntaxes/02_Extra/TypeScript diff --git a/assets/syntaxes/TypeScript.sublime-syntax b/assets/syntaxes/02_Extra/TypeScript.sublime-syntax similarity index 100% rename from assets/syntaxes/TypeScript.sublime-syntax rename to assets/syntaxes/02_Extra/TypeScript.sublime-syntax diff --git a/assets/syntaxes/TypsecriptReact.sublime-syntax b/assets/syntaxes/02_Extra/TypsecriptReact.sublime-syntax similarity index 100% rename from assets/syntaxes/TypsecriptReact.sublime-syntax rename to assets/syntaxes/02_Extra/TypsecriptReact.sublime-syntax diff --git a/assets/syntaxes/Verilog b/assets/syntaxes/02_Extra/Verilog similarity index 100% rename from assets/syntaxes/Verilog rename to assets/syntaxes/02_Extra/Verilog diff --git a/assets/syntaxes/Verilog.sublime-syntax b/assets/syntaxes/02_Extra/Verilog.sublime-syntax similarity index 100% rename from assets/syntaxes/Verilog.sublime-syntax rename to assets/syntaxes/02_Extra/Verilog.sublime-syntax diff --git a/assets/syntaxes/VimL b/assets/syntaxes/02_Extra/VimL similarity index 100% rename from assets/syntaxes/VimL rename to assets/syntaxes/02_Extra/VimL diff --git a/assets/syntaxes/VimL.sublime-syntax b/assets/syntaxes/02_Extra/VimL.sublime-syntax similarity index 100% rename from assets/syntaxes/VimL.sublime-syntax rename to assets/syntaxes/02_Extra/VimL.sublime-syntax diff --git a/assets/syntaxes/Vue b/assets/syntaxes/02_Extra/Vue similarity index 100% rename from assets/syntaxes/Vue rename to assets/syntaxes/02_Extra/Vue diff --git a/assets/syntaxes/hosts b/assets/syntaxes/02_Extra/hosts similarity index 100% rename from assets/syntaxes/hosts rename to assets/syntaxes/02_Extra/hosts diff --git a/assets/syntaxes/requirementstxt b/assets/syntaxes/02_Extra/requirementstxt similarity index 100% rename from assets/syntaxes/requirementstxt rename to assets/syntaxes/02_Extra/requirementstxt diff --git a/assets/syntaxes/requirementstxt.sublime-syntax b/assets/syntaxes/02_Extra/requirementstxt.sublime-syntax similarity index 100% rename from assets/syntaxes/requirementstxt.sublime-syntax rename to assets/syntaxes/02_Extra/requirementstxt.sublime-syntax diff --git a/assets/syntaxes/show-nonprintable.sublime-syntax b/assets/syntaxes/02_Extra/show-nonprintable.sublime-syntax similarity index 100% rename from assets/syntaxes/show-nonprintable.sublime-syntax rename to assets/syntaxes/02_Extra/show-nonprintable.sublime-syntax diff --git a/assets/syntaxes/ssh-config b/assets/syntaxes/02_Extra/ssh-config similarity index 100% rename from assets/syntaxes/ssh-config rename to assets/syntaxes/02_Extra/ssh-config diff --git a/assets/syntaxes/varlink b/assets/syntaxes/02_Extra/varlink similarity index 100% rename from assets/syntaxes/varlink rename to assets/syntaxes/02_Extra/varlink diff --git a/assets/syntaxes/FSharp.sublime-syntax b/assets/syntaxes/FSharp.sublime-syntax deleted file mode 100644 index d7fb5257..00000000 --- a/assets/syntaxes/FSharp.sublime-syntax +++ /dev/null @@ -1,672 +0,0 @@ -%YAML 1.2 ---- -# http://www.sublimetext.com/docs/3/syntax.html -name: "F#" -file_extensions: - - fs - - fsi - - fsx -scope: source.fsharp -contexts: - main: - - include: compiler_directives - - include: comments - - include: constants - - include: strings - - include: chars - - include: double_tick - - include: definition - - include: abstract_definition - - include: attributes - - include: modules - - include: anonymous_functions - - include: du_declaration - - include: record_declaration - - include: records - - include: strp_inlined - - include: keywords - - include: cexprs - - include: text - abstract_definition: - - match: '\b(abstract)\s+(member)?(\s+\[\<.*\>\])?\s*([_[:alpha:]0-9,\._`\s]+)(:)' - captures: - 1: keyword.fsharp - 2: keyword.fsharp - 3: support.function.attribute.fsharp - 5: keyword.fsharp - push: - - meta_scope: abstract.definition.fsharp - - match: \s*(with)\b|=|$ - captures: - 1: keyword.fsharp - pop: true - - include: comments - - include: common_declaration - - match: '(\?{0,1})([[:alpha:]0-9''`^._ ]+)\s*(:)(\s*([[:alpha:]0-9''`^._ ]+)){0,1}' - captures: - 1: keyword.symbol.fsharp - 2: variable.parameter.fsharp - 3: keyword.symbol.fsharp - 4: entity.name.type.fsharp - - match: '(?!with|get|set\b)\b([\w0-9''`^._]+)' - captures: - 1: entity.name.type.fsharp - - include: keywords - anonymous_functions: - - match: \b(fun)\b - captures: - 1: keyword.fsharp - push: - - meta_scope: function.anonymous - - match: (->) - captures: - 1: keyword.fsharp - pop: true - - include: comments - - match: (\() - captures: - 1: keyword.symbol.fsharp - push: - - match: \s*(?=(->)) - captures: - 1: keyword.symbol.fsharp - pop: true - - include: member_declaration - - include: variables - attributes: - - match: '\[\<' - push: - - meta_scope: support.function.attribute.fsharp - - match: '\>\]|\]' - pop: true - - include: main - cexprs: - - match: '\b(async|seq|promise|task|maybe|asyncMaybe|controller|scope|application|pipeline)\s*\{' - scope: cexpr.fsharp - captures: - 0: keyword.fsharp - chars: - - match: ('\\?.') - scope: char.fsharp - captures: - 1: string.quoted.single.fsharp - comments: - - match: (\(\*(?!\))) - captures: - 1: comment.block.fsharp - push: - - meta_scope: comment.block.fsharp - - match: (\*\)) - captures: - 1: comment.block.fsharp - pop: true - - match: //.*$ - scope: comment.line.double-slash.fsharp - common_binding_definition: - - include: comments - - include: attributes - - match: (:)\s*(\()\s*(static member|member) - captures: - 1: keyword.symbol.fsharp - 2: keyword.symbol.fsharp - 3: keyword.fsharp - push: - - match: (\))\s*((?=,)|(?=\=)) - captures: - 1: keyword.symbol.fsharp - pop: true - - match: '(\^[[:alpha:]0-9''._]+)' - captures: - 1: entity.name.type.fsharp - - include: variables - - include: keywords - - match: (:)\s*(\() - captures: - 1: keyword.symbol.fsharp - 2: keyword.symbol.fsharp - push: - - match: '(\)\s*(([?[:alpha:]0-9''`^._ ]*)))' - captures: - 1: keyword.symbol.fsharp - 2: entity.name.type.fsharp - pop: true - - include: tuple_signature - - match: '(:)\s*(\^[[:alpha:]0-9''._]+)\s*(when)' - captures: - 1: keyword.symbol.fsharp - 2: entity.name.type.fsharp - 3: keyword.fsharp - push: - - match: (?=:) - captures: - 1: keyword.symbol.fsharp - pop: true - - match: \b(and|when|or)\b - scope: keyword.fsharp - - match: "([[:alpha:]0-9'^._]+)" - comment: Because we first capture the keywords, we can capture what looks like a word and assume it's an entity definition - captures: - 1: entity.name.type.fsharp - - match: (\(|\)) - scope: keyword.symbol.fsharp - - match: '(:)\s*([?[:alpha:]0-9''`^._ ]+)' - captures: - 1: keyword.symbol.fsharp - 2: entity.name.type.fsharp - - match: '(->)\s*(\()?\s*([?[:alpha:]0-9''`^._ ]+)*' - captures: - 1: keyword.symbol.fsharp - 2: keyword.symbol.fsharp - 3: entity.name.type.fsharp - - match: (\*)\s*(\() - captures: - 1: keyword.symbol.fsharp - 2: keyword.symbol.fsharp - push: - - match: '(\)\s*(([?[:alpha:]0-9''`^._ ]+))+)' - captures: - 1: keyword.symbol.fsharp - 2: entity.name.type.fsharp - pop: true - - include: tuple_signature - - match: '(\*)(\s*([?[:alpha:]0-9''`^._ ]+))*' - captures: - 1: keyword.symbol.fsharp - 2: entity.name.type.fsharp - - match: '(<(?![[:space:]]*\)))' - captures: - 1: keyword.symbol.fsharp - push: - - match: ((?) - captures: - 1: keyword.symbol.fsharp - pop: true - - include: generic_declaration - - match: "({)" - captures: - 1: keyword.symbol.fsharp - push: - - match: "(})" - captures: - 1: keyword.symbol.fsharp - pop: true - - include: record_signature - - include: definition - - include: variables - - include: keywords - common_declaration: - - match: '\s*(->)\s*([[:alpha:]0-9''`^._ ]+)(<)' - captures: - 1: keyword.symbol.fsharp - 2: entity.name.type.fsharp - 3: keyword.symbol.fsharp - push: - - match: (>) - captures: - 1: keyword.symbol.fsharp - pop: true - - match: "([[:alpha:]0-9'`^._ ]+)" - captures: - 1: entity.name.type.fsharp - - include: keywords - - match: '\s*(->)\s*(?!with|get|set\b)\b([\w0-9''`^._]+)' - captures: - 1: keyword.symbol.fsharp - 2: entity.name.type.fsharp - - match: '(\?{0,1})([[:alpha:]0-9''`^._ ]+)\s*(:)(\s*([?[:alpha:]0-9''`^._ ]+)(<))' - captures: - 1: keyword.symbol.fsharp - 2: variable.parameter.fsharp - 3: keyword.symbol.fsharp - 4: keyword.symbol.fsharp - 5: entity.name.type.fsharp - push: - - match: (>) - captures: - 1: keyword.symbol.fsharp - pop: true - - match: "([[:alpha:]0-9'`^._ ]+)" - captures: - 1: entity.name.type.fsharp - - include: keywords - compiler_directives: - - match: \s?(#if|#elif|#else|#elseif|#endif|#light|#nowarn) - scope: compiler_directive.fsharp - captures: - constants: - - match: \(\) - scope: constant.language.unit.fsharp - - match: '\b-?[0-9][0-9_]*((\.([0-9][0-9_]*([eE][+-]??[0-9][0-9_]*)?)?)|([eE][+-]??[0-9][0-9_]*))' - scope: constant.numeric.floating-point.fsharp - - match: '\b(-?((0(x|X)[0-9a-fA-F][0-9a-fA-F_]*)|(0(o|O)[0-7][0-7_]*)|(0(b|B)[01][01_]*)|([0-9][0-9_]*)))' - scope: constant.numeric.integer.nativeint.fsharp - - match: \b(true|false|null|unit)\b - scope: constant.others.fsharp - definition: - - match: '\b(let mutable|static let mutable|let inline|let|member val|static member inline|static member|default|member|override|let!)(\s+rec|mutable)?(\s+\[\<.*\>\])?\s*(private|internal|public)?\s+(\[[^-=]*\]|[_[:alpha:]]([_[:alpha:]0-9,\._]+)*|``[_[:alpha:]]([_[:alpha:]0-9,\._`\s]+|(?<=,)\s)*)?' - captures: - 1: keyword.fsharp - 2: keyword.fsharp - 3: support.function.attribute.fsharp - 4: keyword.fsharp - 5: variable.fsharp - push: - - meta_scope: binding.fsharp - - match: \s*(with\b|=|\n+=|(?<=\=)) - captures: - 1: keyword.fsharp - pop: true - - include: common_binding_definition - - match: '\b(static val mutable|val mutable|val)(\s+rec|mutable)?(\s+\[\<.*\>\])?\s*(private|internal|public)?\s+(\[[^-=]*\]|[_[:alpha:]]([_[:alpha:]0-9,\._]+)*|``[_[:alpha:]]([_[:alpha:]0-9,\._`\s]+|(?<=,)\s)*)?' - captures: - 1: keyword.fsharp - 2: keyword.fsharp - 3: support.function.attribute.fsharp - 4: keyword.fsharp - 5: variable.fsharp - push: - - meta_scope: binding.fsharp - - match: \n$ - pop: true - - include: common_binding_definition - double_tick: - - match: (``)(.*)(``) - scope: variable.other.binding.fsharp - captures: - 1: string.quoted.single.fsharp - 2: variable.other.binding.fsharp - 3: string.quoted.single.fsharp - du_declaration: - - match: \b(of)\b - captures: - 1: keyword.fsharp - push: - - meta_scope: du_declaration.fsharp - - match: $|(\|) - captures: - 1: keyword.symbol.fsharp - pop: true - - include: comments - - match: '([[:alpha:]0-9''`<>^._]+|``[[:alpha:]0-9'' <>^._]+``)\s*(:)\s*([[:alpha:]0-9''`<>^._]+|``[[:alpha:]0-9'' <>^._]+``)' - captures: - 1: variable.parameter.fsharp - 2: keyword.symbol.fsharp - 3: entity.name.type.fsharp - - match: "([[:alpha:]0-9'`^._]+)|``([[:alpha:]0-9'^._ ]+)``" - captures: - 1: entity.name.type.fsharp - - include: keywords - generic_declaration: - - match: (:)\s*(\()\s*(static member|member) - captures: - 1: keyword.symbol.fsharp - 2: keyword.symbol.fsharp - 3: keyword.fsharp - push: - - match: (\)) - captures: - 1: keyword.symbol.fsharp - pop: true - - match: (\() - captures: - 1: keyword.symbol.fsharp - push: - - match: (\)) - captures: - 1: keyword.symbol.fsharp - pop: true - - include: member_declaration - - match: '((''|\^)[[:alpha:]0-9''._]+)' - captures: - 1: entity.name.type.fsharp - - include: variables - - include: keywords - - match: \b(private|to|public|internal|function|yield!|yield|class|exception|match|delegate|of|new|in|as|if|then|else|elif|for|begin|end|inherit|do|let\!|return\!|return|interface|with|abstract|property|union|enum|member|try|finally|and|when|use|use\!|struct|while|mutable)(?!')\b - scope: keyword.fsharp - - match: ":" - scope: keyword.fsharp - - include: constants - - match: '((''|\^)[[:alpha:]0-9''._]+)' - captures: - 1: entity.name.type.fsharp - - match: (<) - captures: - 1: keyword.symbol.fsharp - push: - - match: (>) - captures: - 1: keyword.symbol.fsharp - pop: true - - match: '((''|\^)[[:alpha:]0-9''._]+)' - captures: - 1: entity.name.type.fsharp - - include: tuple_signature - - include: generic_declaration - - match: '(?!when|and|or\b)\b([\w0-9''`^._]+)' - captures: - 1: entity.name.type.fsharp - - match: (\|) - captures: - 1: keyword.symbol.fsharp - - include: keywords - keywords: - - match: \b(private|to|public|internal|function|yield!|yield|class|exception|match|delegate|of|new|in|as|if|then|else|elif|for|begin|end|inherit|do|let\!|return\!|return|interface|with|abstract|property|union|enum|member|try|finally|and|when|or|use|use\!|struct|while|mutable)(?!')\b - scope: keyword.fsharp - - match: '(&&&|\|\|\||\^\^\^|~~~|<<<|>>>|\|>|\->|\<\-|:>|:\?>|:|\[|\]|\;|<>|=|@|\|\||&&|{|}|\||_|\.\.|\,|\+|\-|\*|\/|\^|\!|\>|\>\=|\>\>|\<|\<\=|\(|\)|\<\<)' - scope: keyword.symbol.fsharp - member_declaration: - - include: comments - - include: common_declaration - - match: (:)\s*(\()\s*(static member|member) - captures: - 1: keyword.symbol.fsharp - 2: keyword.symbol.fsharp - 3: keyword.fsharp - push: - - match: (\))\s*((?=,)|(?=\=)) - captures: - 1: keyword.symbol.fsharp - pop: true - - match: (\() - captures: - 1: keyword.symbol.fsharp - push: - - match: (\)) - captures: - 1: keyword.symbol.fsharp - pop: true - - include: member_declaration - - match: '(\^[[:alpha:]0-9''._]+)' - captures: - 1: entity.name.type.fsharp - - include: variables - - include: keywords - - match: '(\^[[:alpha:]0-9''._]+)' - captures: - 1: entity.name.type.fsharp - - match: \b(and|when|or)\b - scope: keyword.fsharp - - match: (\(|\)) - scope: keyword.symbol.fsharp - - match: '(\?{0,1})([[:alpha:]0-9''`^._]+|``[[:alpha:]0-9''`^:,._ ]+``)\s*(:{0,1})(\s*([?[:alpha:]0-9''`<>._ ]+)){0,1}' - captures: - 1: keyword.symbol.fsharp - 2: variable.parameter.fsharp - 3: keyword.symbol.fsharp - 4: entity.name.type.fsharp - - include: keywords - modules: - - match: '\b(namespace|module)\s*(public|internal|private)?\s+([[:alpha:]][[:alpha:]0-9''_. ]*)' - captures: - 1: keyword.fsharp - 2: keyword.fsharp - 3: entity.name.section.fsharp - push: - - meta_scope: entity.name.section.fsharp - - match: (\s?=|\s|$) - captures: - 1: keyword.symbol.fsharp - pop: true - - match: '(\.)([A-Z][[:alpha:]0-9''_]*)' - scope: entity.name.section.fsharp - captures: - 1: punctuation.separator.namespace-reference.fsharp - 2: entity.name.section.fsharp - - match: '\b(open)\s+([[:alpha:]][[:alpha:]0-9''_]*)(?=(\.[A-Z][[:alpha:]0-9_]*)*)' - captures: - 1: keyword.fsharp - 2: entity.name.section.fsharp - push: - - meta_scope: namespace.open.fsharp - - match: (\s|$) - pop: true - - match: '(\.)([[:alpha:]][[:alpha:]0-9''_]*)' - scope: entity.name.section.fsharp - captures: - 1: punctuation.separator.namespace-reference.fsharp - 2: entity.name.section.fsharp - - match: '^\s*(module)\s+([A-Z][[:alpha:]0-9''_]*)\s*(=)\s*([A-Z][[:alpha:]0-9''_]*)' - captures: - 1: keyword.fsharp - 2: entity.name.type.namespace.fsharp - 3: punctuation.separator.namespace-definition.fsharp - 4: entity.name.section.fsharp - push: - - meta_scope: namespace.alias.fsharp - - match: (\s|$) - pop: true - - match: '(\.)([A-Z][[:alpha:]0-9''_]*)' - scope: entity.name.section.fsharp - captures: - 1: punctuation.separator.namespace-reference.fsharp - 2: entity.name.section.fsharp - record_declaration: - - match: '(\{)' - captures: - 1: keyword.symbol.fsharp - push: - - match: '(?<=\})' - pop: true - - include: comments - - match: '(((mutable)\s[[:alpha:]]+)|[[:alpha:]0-9''`<>^._]*)\s*((?) - captures: - 1: keyword.fsharp - pop: true - - match: '((''|\^)``[[:alpha:]0-9`^:,._ ]+``|(''|\^)[[:alpha:]0-9`^:._]+)' - captures: - 1: entity.name.type.fsharp - - match: \b(interface|with|abstract|and|when|or|not|struct|equality|comparison|unmanaged|delegate|enum)\b - scope: keyword.fsharp - - match: (\() - captures: - 1: keyword.symbol.fsharp - push: - - match: (\)) - captures: - 1: keyword.symbol.fsharp - pop: true - - match: (static member|member|new) - captures: - 1: keyword.fsharp - - include: common_binding_definition - - match: '([\w0-9''`^._]+)' - captures: - 1: entity.name.type.fsharp - - include: keywords - - match: \s*(private|internal|public) - captures: - 1: keyword.symbol.fsharp - 2: keyword.fsharp - - match: (\() - captures: - 1: keyword.symbol.fsharp - push: - - match: '\s*(?=(=)|[\n=]|(\(\))|(as))' - captures: - 1: keyword.symbol.fsharp - pop: true - - include: member_declaration - - include: keywords - string_formatter: - - match: (%0?-?(\d+)?((a|t)|(\.\d+)?(f|F|e|E|g|G|M)|(b|c|s|d|i|x|X|o|u)|(s|b|O)|(\+?A))) - scope: entity.name.type.format.specifier.fsharp - captures: - 1: keyword.format.specifier.fsharp - strings: - - match: '(?=[^\\])(@")' - captures: - 1: punctuation.definition.string.begin.fsharp - push: - - meta_scope: string.quoted.literal.fsharp - - match: (")(?!") - captures: - 1: punctuation.definition.string.end.fsharp - pop: true - - match: '"(")' - scope: constant.character.string.escape.fsharp - - match: '(?=[^\\])(""")' - captures: - 1: punctuation.definition.string.begin.fsharp - push: - - meta_scope: string.quoted.triple.fsharp - - match: (""") - captures: - 1: punctuation.definition.string.end.fsharp - pop: true - - include: string_formatter - - match: '(?=[^\\])(")' - captures: - 1: punctuation.definition.string.begin.fsharp - push: - - meta_scope: string.quoted.double.fsharp - - match: (") - captures: - 1: punctuation.definition.string.end.fsharp - pop: true - - match: '\\$[ \t]*' - scope: punctuation.separator.string.ignore-eol.fsharp - - match: '\\([\\''''ntbr]|u[a-fA-F0-9]{4}|u[a-fA-F0-9]{8})' - scope: constant.character.string.escape.fsharp - - match: '\\(?![\\''''ntbr]|u[a-fA-F0-9]{4}|u[a-fA-F0-9]{8}).' - scope: invalid.illeagal.character.string.fsharp - - include: string_formatter - strp_inlined: - - match: (\() - captures: - 1: keyword.symbol.fsharp - push: - - match: (\)) - captures: - 1: keyword.symbol.fsharp - pop: true - - include: strp_inlined_body - strp_inlined_body: - - include: comments - - include: anonymous_functions - - match: '(\^[[:alpha:]0-9''._]+)' - captures: - 1: entity.name.type.fsharp - - match: \b(and|when|or)\b - scope: keyword.fsharp - - match: (\() - captures: - 1: keyword.symbol.fsharp - push: - - match: (\)) - captures: - 1: keyword.symbol.fsharp - pop: true - - include: strp_inlined_body - - match: '(static member|member)\s*([[:alpha:]0-9''`<>^._]+|``[[:alpha:]0-9'' <>^._]+``)\s*(:)' - captures: - 1: keyword.fsharp - 2: variable.fsharp - 3: keyword.symbol.fsharp - - include: compiler_directives - - include: constants - - include: strings - - include: chars - - include: double_tick - - include: keywords - - include: text - - include: definition - - include: attributes - - include: keywords - - include: cexprs - - include: text - text: - - match: \\ - scope: text.fsharp - tuple_signature: - - match: "(([?[:alpha:]0-9'`^._ ]+))+" - captures: - 1: entity.name.type.fsharp - - match: (\() - captures: - 1: keyword.symbol.fsharp - push: - - match: (\)) - captures: - 1: keyword.symbol.fsharp - pop: true - - match: "(([?[:alpha:]0-9'`^._ ]+))+" - captures: - 1: entity.name.type.fsharp - - include: tuple_signature - - include: keywords - variables: - - match: \(\) - scope: constant.language.unit.fsharp - - match: '(\?{0,1})(``[[:alpha:]0-9''`^:,._ ]+``|[[:alpha:]0-9''`<>^._ ]\w*)' - captures: - 1: keyword.symbol.fsharp - 2: variable.parameter.fsharp diff --git a/assets/themes.bin b/assets/themes.bin index 23ad9132..484b3fbc 100644 Binary files a/assets/themes.bin and b/assets/themes.bin differ diff --git a/build.rs b/build.rs index 469b5326..bff88e9f 100644 --- a/build.rs +++ b/build.rs @@ -7,6 +7,7 @@ extern crate liquid; use std::error::Error; use std::fs; +use std::path::Path; // Read environment variables. lazy_static! { @@ -17,34 +18,13 @@ lazy_static! { .unwrap_or("bat"); } -fn init_template() -> liquid::value::Object { - let mut globals = liquid::value::Object::new(); - - globals.insert( - "PROJECT_NAME".into(), - liquid::value::Value::scalar(PROJECT_NAME.to_owned()), - ); - - globals.insert( - "PROJECT_EXECUTABLE".into(), - liquid::value::Value::scalar(EXECUTABLE_NAME.to_owned()), - ); - - globals.insert( - "PROJECT_VERSION".into(), - liquid::value::Value::scalar(PROJECT_VERSION.to_owned()), - ); - - globals -} - /// Generates a file from a liquid template. fn template( - variables: &liquid::value::Object, + variables: &liquid::Object, in_file: &str, - out_file: &str, + out_file: impl AsRef, ) -> Result<(), Box> { - let template = liquid::ParserBuilder::with_liquid() + let template = liquid::ParserBuilder::with_stdlib() .build()? .parse(&fs::read_to_string(in_file)?)?; @@ -53,13 +33,27 @@ fn template( } fn main() -> Result<(), Box> { - let variables = init_template(); + let variables = liquid::object!({ + "PROJECT_NAME": PROJECT_NAME.to_owned(), + "PROJECT_EXECUTABLE": EXECUTABLE_NAME.to_owned(), + "PROJECT_VERSION": PROJECT_VERSION.to_owned(), + }); - template(&variables, "assets/manual/bat.1.in", "assets/manual/bat.1")?; + let out_dir_env = std::env::var_os("OUT_DIR").expect("OUT_DIR to be set in build.rs"); + let out_dir = Path::new(&out_dir_env); + + std::fs::create_dir_all(out_dir.join("assets/manual")).unwrap(); + std::fs::create_dir_all(out_dir.join("assets/completions")).unwrap(); + + template( + &variables, + "assets/manual/bat.1.in", + out_dir.join("assets/manual/bat.1"), + )?; template( &variables, "assets/completions/bat.fish.in", - "assets/completions/bat.fish", + out_dir.join("assets/completions/bat.fish"), )?; Ok(()) diff --git a/ci/before_deploy.bash b/ci/before_deploy.bash index ac4bb159..effd875d 100755 --- a/ci/before_deploy.bash +++ b/ci/before_deploy.bash @@ -38,7 +38,7 @@ pack() { "${gcc_prefix}"strip "$tempdir/$package_name/$PROJECT_NAME" # manpage, readme and license - cp "assets/manual/bat.1" "$tempdir/$package_name/$PROJECT_NAME.1" + cp target/"$TARGET"/release/build/"$PROJECT_NAME"-*/out/assets/manual/bat.1 "$tempdir/$package_name/$PROJECT_NAME.1" cp README.md "$tempdir/$package_name" cp LICENSE-MIT "$tempdir/$package_name" cp LICENSE-APACHE "$tempdir/$package_name" @@ -47,7 +47,7 @@ pack() { # TODO: disabled for now, see issue #372 # cp target/"$TARGET"/release/build/"$PROJECT_NAME"-*/out/"$PROJECT_NAME".bash "$tempdir/$package_name/autocomplete/${PROJECT_NAME}.bash-completion" # cp target/"$TARGET"/release/build/"$PROJECT_NAME"-*/out/"$PROJECT_NAME".fish "$tempdir/$package_name/autocomplete" - cp "assets/completions/bat.fish" "$tempdir/$package_name/autocomplete/$PROJECT_NAME.fish" + cp target/"$TARGET"/release/build/"$PROJECT_NAME"-*/out/assets/completions/bat.fish "$tempdir/$package_name/autocomplete/$PROJECT_NAME.fish" # cp target/"$TARGET"/release/build/"$PROJECT_NAME"-*/out/_"$PROJECT_NAME" "$tempdir/$package_name/autocomplete" # archiving @@ -108,11 +108,11 @@ make_deb() { "${gcc_prefix}"strip "$tempdir/usr/bin/$PROJECT_NAME" # manpage - install -Dm644 "assets/manual/bat.1" "$tempdir/usr/share/man/man1/$PROJECT_NAME.1" + install -Dm644 target/"$TARGET"/release/build/"$PROJECT_NAME"-*/out/assets/manual/bat.1 "$tempdir/usr/share/man/man1/$PROJECT_NAME.1" gzip --best "$tempdir/usr/share/man/man1/$PROJECT_NAME.1" # completions - install -Dm644 "assets/completions/bat.fish" "$tempdir/usr/share/fish/vendor_completions.d/$PROJECT_NAME.fish" + install -Dm644 target/"$TARGET"/release/build/"$PROJECT_NAME"-*/out/assets/completions/bat.fish "$tempdir/usr/share/fish/vendor_completions.d/$PROJECT_NAME.fish" # readme and license install -Dm644 README.md "$tempdir/usr/share/doc/$PROJECT_NAME/README.md" @@ -164,7 +164,8 @@ Package: $dpkgname Version: $version Section: utils Priority: optional -Maintainer: David Peter +Maintainer: $maintainer +Homepage: $homepage Architecture: $architecture Provides: $PROJECT_NAME Conflicts: $conflictname diff --git a/doc/README-ja.md b/doc/README-ja.md index c338e4f2..2906a049 100644 --- a/doc/README-ja.md +++ b/doc/README-ja.md @@ -13,7 +13,7 @@ インストールカスタマイズプロジェクトの目標と既存の類似したOSS • - 翻訳 [中文][日本語] + 翻訳 [中文][日本語][한국어]

### シンタックスハイライト @@ -180,7 +180,7 @@ apt install bat batの最新リリースを実行する場合、または Ubuntu/Debian の古いバージョンを使用している場合は、[release page](https://github.com/sharkdp/bat/releases) から最新の `.deb` パッケージをダウンロードし、 次の方法でインストールします: ```bash -sudo dpkg -i bat_0.12.1_amd64.deb # adapt version number and architecture +sudo dpkg -i bat_0.13.0_amd64.deb # adapt version number and architecture ``` ### On Alpine Linux @@ -500,11 +500,11 @@ export BAT_CONFIG_PATH="/path/to/bat.conf" # Use italic text on the terminal (not supported on all terminals) --italic-text=always -# Use C++ syntax (instead of C) for .h header files ---map-syntax h:cpp +# Use C++ syntax for .ino files +--map-syntax "*.ino:C++" -# Use "gitignore" highlighting for ".ignore" files ---map-syntax .ignore:.gitignore +# Use ".gitignore"-style highlighting for ".ignore" files +--map-syntax ".ignore:Git Ignore" ``` ## Windows での `bat` の利用 diff --git a/doc/README-ko.md b/doc/README-ko.md new file mode 100644 index 00000000..fff0c94b --- /dev/null +++ b/doc/README-ko.md @@ -0,0 +1,560 @@ +

+ bat - a cat clone with wings
+ Build Status + + license + Version info
+ + 문법 강조와 깃 통합 기능의 cat(1) 클론 +

+ +

+ 주요 기능들 • + 사용법 • + 설치 • + 커스터마이즈 • + 프로젝트 목표와 대안들 • + 번역 [中文][日本語] +

+ +### 문법 강조 + +`bat`은 다양한 프로그래밍 언어와 마크업 언어에 대해 문법 강조(Syntax highlighting)기능을 지원하고 있습니다: + +![Syntax highlighting example](https://imgur.com/rGsdnDe.png) + +### Git 통합 + +`bat`은 `git`을 통해 인덱스와 함께 변경분을 표시합니다 (왼쪽 바를 확인하세요): + +![Git integration example](https://i.imgur.com/2lSW4RE.png) + +### 표시할 수 없는 문자 처리 + +`-A`/`--show-all` 옵션을 사용하여 표시할수 없는 문자를 시각화 해줍니다: + +![Non-printable character example](https://i.imgur.com/WndGp9H.png) + +### 자동 페이징 + +하나의 화면에 비해 출력이 너무 큰 경우, `less` 를 이용해 출력들을 연결할 수 있습니다. + +### 파일 연결 + +이 뿐만 아니라 파일을 연결할 때도 사용 할 수 있습니다. :wink: `bat`가 인터렉티브 하지 않은(non-interactive)가 감지하면 (예를 들어,다른 프로세스 혹은 파일과 파이프라인을 연결 한 경우) `bat`은 `cat`을 대신하여 동작하며 일반 파일 내용을 표기해줍니다. + +## 사용법 + +터미널에서 하나의 파일 표시하기 + +```bash +> bat README.md +``` + +여러 파일 한번에 보여주기 + +```bash +> bat src/*.rs +``` + +stdin에서 읽고, 자동으로 맞는 문법 강조 적용하기 + +```bash +> curl -s https://sh.rustup.rs | bat +``` + +stdin에서 읽고, 명시적으로 언어 지정하여 적용하기 + +```bash +> yaml2json .travis.yml | json_pp | bat -l json +``` + +표시할 수 없는 문자 처리하기 +```bash +> bat -A /etc/hosts +``` + +`cat` 대신 사용하기: + +```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'. +``` + +### 다른 툴과의 통합 + +#### `find` 와 `fd` + +`find`의 `-exec` 옵션을 사용하여 `bat`의 모든 검색 결과를 미리 볼 수 있습니다: +```bash +find … -exec bat {} + +``` + +[`fd`](https://github.com/sharkdp/fd)를 사용하고 있는 경우, `-X`/`--exec-batch` 옵션을 이용하여 동일하게 사용할 수 있습니다: +```bash +fd … -X bat +``` + +#### `ripgrep` + +[`batgrep`](https://github.com/eth-p/bat-extras/blob/master/doc/batgrep.md)과 함께, [`ripgrep`](https://github.com/BurntSushi/ripgrep)의 검색 결과를 `bat`을 이용하여 볼 수 있습니다. + +```bash +batgrep needle src/ +``` + +#### `tail -f` + +`bat` 과 `tail -f`를 함께 사용하여, 특정 파일을 문법 강조하며 지속적으로 모니터링 할 수 있습니다. +```bash +tail -f /var/log/pacman.log | bat --paging=never -l log +``` +이 작업을 하려면 페이징 기능을 꺼야합니다. 또, 자동 감지가 되지 않기 때문에, 적용되어야할 문법을 명시적(`-l log`)으로 지정해야 합니다. + +#### `git` + +`bat`과 `git show`를 함께 사용하여 주어진 파일의 이전 기록을 문법 강조와 함께 볼 수 있습니다: +```bash +git show v0.6.0:src/main.rs | bat -l rs +``` + +diffs 내에서 문법 강조 표시는 현재 지원되지 않습니다. 이 기능은 [`delta`](https://github.com/dandavison/delta)에서 찾아 볼 수 있습니다. + +#### `xclip` + +`bat` 출력에서 라인 넘버와 Git 수정 내역이 같이 있어 파일 내용을 복사하기가 어려울 수도 있습니다. 이 경우에는 `-p`/`--plain` 옵션을 사용 하거나 출력 시 파이프라인으로 `xclip`을 사용하면 됩니다: +```bash +bat main.cpp | xclip +``` +`bat` 에서는 리다이렉트된 것으로 감지하여, 파일 내용만 출력합니다. + +#### `man` + +`bat`은 `MANPAGER` 환경 변수 설정을 통해 `man`에 대하여 컬러 페이져를 사용할 수 있습니다: + +```bash +export MANPAGER="sh -c 'col -bx | bat -l man -p'" +man 2 select +``` + +포매팅 문제가 발생한다면, `MANROFFOPT="-c"` 설정 해야 할 수도 있습니다 . + +새 커맨드에서 이 번들을 사용하려면, [`batman`](https://github.com/eth-p/bat-extras/blob/master/doc/batman.md)을 이용 할 수 있습니다. + + +참고 : [Manpage syntax](../assets/syntaxes/Manpage.sublime-syntax)는 이 저장소에서 개발되고 있으며, 아직 작업 중 입니다. + +#### `prettier` / `shfmt` / `rustfmt` + +[`prettybat`](https://github.com/eth-p/bat-extras/blob/master/doc/prettybat.md) 스크립트는 코드를 포맷팅하고 `bat`으로 출력해주는 랩퍼(wrapper) 입니다. + + +## 설치 + +[![Packaging status](https://repology.org/badge/vertical-allrepos/bat.svg)](https://repology.org/project/bat/versions) + +### On Ubuntu +*... 그리고 기타 Debian 기반의 Linux 배포판들.* + +Ubuntu Eoan 19.10 혹은 Debian unstable sid 이후 버전 부터는 [Ubuntu용 `bat` 패키지](https://packages.ubuntu.com/eoan/bat)나 [Debian용 `bat` 패키지](https://packages.debian.org/sid/bat) 를 설치 할 수 있습니다. + +```bash +apt install bat +``` + +만약 최근 릴리즈된 bat을 사용을 원하거나 buntu/Debian 예전 버전을 사용하는 경우, [릴리즈 페이지](https://github.com/sharkdp/bat/releases)에서 다음과 같이 `.deb` 패키지를 받아 설치 할 수도 있습니다: + +```bash +sudo dpkg -i bat_0.13.0_amd64.deb # adapt version number and architecture +``` + +### On Alpine Linux + +공식 소스를 통해 [`bat` 패키지](https://pkgs.alpinelinux.org/packages?name=bat) 를 설치 할 수 있습니다: + +```bash +apk add bat +``` + +### On Arch Linux + +공식 소스를 통해 [`bat` 패키지](https://www.archlinux.org/packages/community/x86_64/bat/)를 설치할 수 있습니다: + +```bash +pacman -S bat +``` + +### On Fedora + +[공식 Fedora 모듈 저장소](https://docs.fedoraproject.org/en-US/modularity/using-modules/)에서 [`bat` 패키지](https://koji.fedoraproject.org/koji/packageinfo?packageID=27506)을 설치할 수 있습니다: + +```bash +dnf install bat +``` + +### On Gentoo Linux + +공식 소스를 통해 [`bat` 패키지](https://packages.gentoo.org/packages/sys-apps/bat)를 설치할 수 있습니다. + +```bash +emerge sys-apps/bat +``` + +### On Void Linux + +xbps-install를 이용해 `bat`을 설치할 수 있습니다: +```bash +xbps-install -S bat +``` + +### On FreeBSD + +pkg를 이용하여 미리 컴파일된 [`bat` 패키지](https://www.freshports.org/textproc/bat)를 설치할 수 있습니다: + +```bash +pkg install bat +``` + +또는 FreeBSD 포트에서 직접 빌드할 수도 있습니다: + +```bash +cd /usr/ports/textproc/bat +make install +``` + +### Via nix + +[nix package manager](https://nixos.org/nix)를 이용해 `bat`을 설치할 수 있습니다: + +```bash +nix-env -i bat +``` + +### On openSUSE + +zypper을 이용해 `bat`을 설치할 수 있습니다: + +```bash +zypper install bat +``` + +### On macOS + +[Homebrew](http://braumeister.org/formula/bat)를 이용해 `bat`을 설치할 수 있습니다: + +```bash +brew install bat +``` + +또는 [MacPorts](https://ports.macports.org/port/bat/summary)를 사용할 수도 있습니다: + +```bash +port install bat +``` + +### On Windows + +Windows에서 `bat`을 설치할 수 있는 몇 가지 옵션들이 있습니다. 먼저 `bat`을 설치 한 후, ["Windows에서 사용하기"](#Windows에서-사용하기) 참고하시기 바랍니다. + +#### With Chocolatey + +[Chocolatey](https://chocolatey.org/packages/Bat)를 이용해 `bat`을 설치할 수 있습니다: +```bash +choco install bat +``` + +#### With Scoop + +[scoop](https://scoop.sh/)을 이용해 `bat`을 설치할 수 있습니다: +```bash +scoop install bat +``` +[Visual C++ Redistributable 패키지](https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads)를 같이 설치해 주어야 합니다. + +#### From prebuilt binaries: + +[릴리즈 페이지](https://github.com/sharkdp/bat/releases)에서 빌드된 바이너리를 다운받을 수 있습니다. + +[Visual C++ Redistributable 패키지](https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads)를 같이 설치해 주어야 합니다. + +### Via 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' +``` + +### Via Ansible + +[Ansible](https://www.ansible.com/)을 사용해 `bat`을 설치할 수 있습니다: + +```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.36 이상이 필요하며 `cargo`를 이용해 빌드할 수 있습니다. + +```bash +cargo install bat +``` + +일부 플랫폼에서는 `llvm` 그리고/또는 `libclang-dev` 설치가 필요할 수도 있습니다. + +## 커스터마이즈 + +### 문법 강조 테마 + +`bat --list-themes`을 사용하면, 현재 사용 가능한 문법 강조 테마들을 확인할 수 있습니다. `TwoDark` 테마 선택하는 경우, `--theme=TwoDark` 옵션과 함께 `bat`을 사용하거나 환경변수에서 `BAT_THEME`를 `TwoDark`로 세팅해주면 됩니다. 쉘 시작 파일에 `export BAT_THEME="TwoDark"` 를 정의해 계속 사용도 가능합니다. 이 밖에 `bat`의 [설정 파일](#설정-파일)을 이용할 수도 있습니다. + +다른 테마를 미리 보고 싶은경우 다음 명령어와 같이 사용할 수 있습니다.(이 경우 [`fzf`](https://github.com/junegunn/fzf)가 필요합니다.) + +```bash +bat --list-themes | fzf --preview="bat --theme={} --color=always /path/to/file" +``` +`bat`의 기본 테마는 어두운 배경색 터미널에 적합합니다. 만일 밝은 배경색을 사용할 경우에는 `GitHub` 이나 `OneHalfLight` 과 같은 테마가 더 잘 어울립니다. 아래 [새로운 테마 추가하기](#새로운-테마-추가하기)에 따라 커스텀 테마를 사용할수도 있습니다. + +### 출력 스타일 + +`--style` 옵션을 이용하여 `bat`의 출력 스타일을 변경 할 수 있습니다. 예를 들어, `--style=numbers,changes`는 Git 변경분과 라인 넘버에 대해서만 출력하며 눈금과 파일 헤더가 표시되지 않습니다. `BAT_STYLE` 환경 변수로 정의하여 계속해서 사용하거나`bat`의 [설정 파일](#설정-파일)을 사용할 수도 있습니다. + +### 새로운 문법 강조 / 언어 추가하기 + +`bat`은 문법 강조를 위해 [`syntect`](https://github.com/trishume/syntect/) 라이브러리를 사용하고 있습니다. `syntect`는 [Sublime Text의 `.sublime-syntax` 파일](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` 변수를 수정하거나 `BAT_PAGER` 환경 변수로 `PAGER` 대신 정의 할 수도 있습니다. + +만약 커맨드라인 인수로 넘기려면, `PAGER`/`BAT_PAGER` 변수를 정의를 통해 사용 할 수 있습니다. : + +```bash +export BAT_PAGER="less -RF" +``` + +환경 변수 대신, `bat`의 [설정 파일](#설정-파일)에서 페이져를 설정 할 수도 있습니다.(`--pager` 옵션) + +**참고**: 기본적으로 페이져가 `less`로 설정 되어있다면, `bat`은 다음 옵션들을 받을 수 있습니다: `-R`/`--RAW-CONTROL-CHARS`, +`-F`/`--quit-if-one-screen` 그리고 `-X`/`--no-init`. 마지막 옵션(`-X`)은 530 이전 버전에서만 사용됩니다. + +`-R` 옵션은 ANSI 컬러를 올바르게 해석하기 위해 필요합니다. 두번째 옵션 (`-F`)은 출력 크기가 터미널의 세로 크기보다 작을 경우 즉시 종료되도록 합니다. +페이져를 종료하기 위해 `q`를 누를 필요 없기 때문에 작은 파일을 다룰 때 용이합니다. 세번째 옵션(`-X`)는 `less` 이전 버전의 `--quit-if-one-screen` 기능과 함께 버그를 잡을 때 필요합니다. 안타깝게도, `less`의 마우스 휠 지원은 종료합니다. + +`less` 예전 버전에서 마우스 휠 기능을 활성화 시키려면, `-R` 옵션을 사용하면 됩니다. (위의 예제처럼, 이 옵션은 quit-if-one-screen 기능을 비활성화 시킵니다.) +530 이하 버전에서는 그대로 사용할 수 있습니다. + +### 다크 모드 + +macOS에서 다크 모드를 사용하고 있다면, OS 테마에 따라 다른 테마를 사용하도록 `bat`의 구성할 수 있습니다. 아래 코드는 라이트 모드에서는 `default` 테마를 다크모드에서는 `Github` 테마를 사용하는 방법입니다. + +```bash +alias cat="bat --theme=\$(defaults read -globalDomain AppleInterfaceStyle &> /dev/null && echo default || echo GitHub)" +``` + +## 설정 파일 + +`bat` 설정 파일로 커스터마이즈 할 수 있습니다. 파일의 위치는 운영 체제에 따라 다릅니다. 아래 커맨드를 통해 시스템의 기본 경로를 알 수 있습니다. +``` +bat --config-file +``` + +또는, `BAT_CONFIG_PATH` 환경 변수를 사용하여 `bat`의 설정 파일 위치를 지정할 수 있습니다. +```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 + +# Use C++ syntax for .ino files +--map-syntax "*.ino:C++" + +# Use ".gitignore"-style highlighting for ".ignore" files +--map-syntax ".ignore:Git Ignore" +``` + +## Windows에서 사용하기 + +`bat` 대부분의 경우 Windows에서 기본적으로 잘 작동하지만, 일부 기능에는 추가 적인 구성이 필요할 수 있습니다. + +### 페이징 + +Windows는 `more` 형식의 매우 제한된 페이저만이 포함되어있습니다. `less`용 Windows 바이너리는 [이 홈페이지](http://www.greenwoodsoftware.com/less/download.html)나 [Chocolatey](https://chocolatey.org/packages/Less)에서 다운로드 받을 수 있습니다. 이를 사용하려면 바이너리를 `PATH` 디렉토리에 배치하거나 [환경 변수로 정의](#using-a-different-pager) 하세요. [Chocolatey 패키지](#on-windows)로 `less`를 자동으로 설치할 수 있습니다. + +### 색상 + +Windows 10은 기본 내장기능으로 [v1511](https://en.wikipedia.org/wiki/Windows_10_version_history#Version_1511_(November_Update)) 이후의 `conhost.exe`(Command Prompt) 와 PowerShell, 그리고 최신 버전의 bash에서 색상을 지원합니다. 이전 버전의 Windows에서는, [ConEmu](https://conemu.github.io/)가 포함 된 [Cmder](http://cmder.net/)를 사용할 수 있습니다 . + +**참고:** `less`의 Git과 MSYS 버전은 Windows에서 색상을 올바르게 해석하지 않습니다. 다른 페이져가 설치되어 있지 않은 경우, `--paging=never` 하거나 `BAT_PAGER`를 빈 문자열로 설정하여 페이징을 완전히 비활성화 할 수 있습니다 . + +### Cygwin + +Windows에서의 `bat`은 기본적으로 Cygwin의 unix 스타일의 경로(`/cygdrive/*`)를 지원하지 않습니다. cygwin 절대경로를 인자로 받았을 때, `bat`은 다음과 같이 오류를 반환합니다. `:The system cannot find the path specified. (os error 3)` + +이 경우, wrapper를 만들거나 다음 함수를 `.bash_profile`추가하여 문제를 해결하실 수 있습니다 : + +```bash +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 escape sequence를 지원되는지 여부를 판단 할 수 없습니다. (그리고 8-bit 색상으로 돌아갑니다.) + +### 라인 숫자와 눈금이 잘 보이지 않는 경우 + +다른 테마를 사용해 보세요. (`bat --list-themes`에서 테마들을 확인해 볼 수 있습니다.) `OneHalfDark` 과 `OneHalfLight` 테마는 눈금과 선의 색을 밝게 합니다. + +### 파일 인코딩 + +`bat`은 기본적으로 UTF-8과 UTF-8을 제공합니다. 다른 파일 인코딩의 경우, 자동 감지 되지 않으므로 UTF-8로 먼저 변환해 주어야 합니다. 이렇게 할 때, `iconv`를 사용 할 수 있습니다. 예를 들어, Latin-1 (ISO-8859-1)로 인코딩된 PHP파일이라면 다음과 같이 사용할 수 있습니다.: +``` bash +iconv -f ISO-8859-1 -t UTF-8 my-file.php | bat +``` +참고: `bat`으로 자동 감지가 되지 않는 경우에는 `-l`/`--language` 옵션을 사용할 수도 있습니다. + +## 배포 + +```bash +# Recursive clone to retrieve all submodules +git clone --recursive https://github.com/sharkdp/bat + +# Build (debug version) +cd bat +cargo build --bins + +# 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 +``` + +## 메인테이너들 + +- [sharkdp](https://github.com/sharkdp) +- [eth-p](https://github.com/eth-p) + +## 프로젝트 목표와 대안들 + +`bat`은 아래와 같은 목표를 달성하려고 합니다: + +- 아름답고 발전된 문법 강조 기능 +- Git 연동을 통한 파일 수정 내역 확인 +- (POSIX)`cat`의 대체제 +- 사용자 친화적인 CLI 제공 + + +비슷한 프로그램들을 찾고 있다면, 많은 대안들이 있습니다. 비교는 [이 문서]((doc/alternatives.md))를 참조해주세요. + +## 라이센스 +Copyright (c) 2018-2020 [bat-developers](https://github.com/sharkdp/bat). + +`bat`는 MIT 라이센스 및 Apache 라이센스 2.0의 조건에 따라 배포됩니다. + +라이센스 세부사항은 [LICENSE-APACHE](LICENSE-APACHE)와 [LICENSE-MIT](LICENSE-MIT)를 참조하세요. diff --git a/examples/cat.rs b/examples/cat.rs new file mode 100644 index 00000000..73d8bb2b --- /dev/null +++ b/examples/cat.rs @@ -0,0 +1,33 @@ +/// A very simple colorized `cat` clone, using `bat` as a library. +/// See `src/bin/bat` for the full `bat` application. +use bat::{ + config::{Config, InputFile, StyleComponent, StyleComponents}, + Controller, HighlightingAssets, +}; +use console::Term; +use std::process; + +fn main() { + let files = std::env::args_os().skip(1).collect::>(); + + if files.is_empty() { + eprintln!("No input files specified"); + process::exit(1); + } + + let config = Config { + term_width: Term::stdout().size().1 as usize, + colored_output: true, + true_color: true, + style_components: StyleComponents::new(&[ + StyleComponent::Header, + StyleComponent::Grid, + StyleComponent::Numbers, + ]), + files: files.iter().map(|file| InputFile::Ordinary(file)).collect(), + ..Default::default() + }; + let assets = HighlightingAssets::from_binary(); + + Controller::new(&config, &assets).run().expect("no errors"); +} diff --git a/examples/simple.rs b/examples/simple.rs index 16e0e71f..009e10c7 100644 --- a/examples/simple.rs +++ b/examples/simple.rs @@ -1,35 +1,20 @@ +/// A simple program that prints its own source code using the bat library use bat::{ - assets::HighlightingAssets, - controller::Controller, - inputfile::InputFile, - style::{OutputComponent, OutputComponents}, - Config, + config::{Config, InputFile}, + Controller, HighlightingAssets, }; -use console::Term; -use std::process; +use std::ffi::OsStr; fn main() { - let files = std::env::args_os().skip(1).collect::>(); - - if files.is_empty() { - eprintln!("No input files specified"); - process::exit(1); - } + let path_to_this_file = OsStr::new(file!()); let config = Config { - term_width: Term::stdout().size().1 as usize, + files: vec![InputFile::Ordinary(path_to_this_file)], colored_output: true, true_color: true, - output_components: OutputComponents::new(&[ - OutputComponent::Header, - OutputComponent::Grid, - OutputComponent::Numbers, - ]), - files: files.iter().map(|file| InputFile::Ordinary(file)).collect(), - theme: "1337".into(), ..Default::default() }; - let assets = HighlightingAssets::new(); + let assets = HighlightingAssets::from_binary(); Controller::new(&config, &assets).run().expect("no errors"); } diff --git a/src/assets.rs b/src/assets.rs index b757e4af..bc87eb36 100644 --- a/src/assets.rs +++ b/src/assets.rs @@ -1,41 +1,35 @@ -use std::borrow::Cow; use std::collections::BTreeMap; use std::fs::{self, File}; use std::io::BufReader; -use std::path::{Path, PathBuf}; +use std::path::Path; use syntect::dumps::{dump_to_file, from_binary, from_reader}; use syntect::highlighting::{Theme, ThemeSet}; use syntect::parsing::{SyntaxReference, SyntaxSet, SyntaxSetBuilder}; -use crate::dirs::PROJECT_DIRS; - use crate::errors::*; use crate::inputfile::{InputFile, InputFileReader}; -use crate::syntax_mapping::SyntaxMapping; - -pub const BAT_THEME_DEFAULT: &str = "Monokai Extended"; +use crate::syntax_mapping::{MappingTarget, SyntaxMapping}; #[derive(Debug)] pub struct HighlightingAssets { - pub syntax_set: SyntaxSet, - pub theme_set: ThemeSet, + pub(crate) syntax_set: SyntaxSet, + pub(crate) theme_set: ThemeSet, + fallback_theme: Option<&'static str>, } impl HighlightingAssets { - pub fn new() -> Self { - Self::from_cache().unwrap_or_else(|_| Self::from_binary()) + pub fn default_theme() -> &'static str { + "Monokai Extended" } - pub fn from_files(dir: Option<&Path>, start_empty: bool) -> Result { - let source_dir = dir.unwrap_or_else(|| PROJECT_DIRS.config_dir()); - - let mut theme_set = if start_empty { + pub fn from_files(source_dir: &Path, include_integrated_assets: bool) -> Result { + let mut theme_set = if include_integrated_assets { + Self::get_integrated_themeset() + } else { ThemeSet { themes: BTreeMap::new(), } - } else { - Self::get_integrated_themeset() }; let theme_dir = source_dir.join("themes"); @@ -48,7 +42,7 @@ impl HighlightingAssets { ); } - let mut syntax_set_builder = if start_empty { + let mut syntax_set_builder = if !include_integrated_assets { let mut builder = SyntaxSetBuilder::new(); builder.add_plain_text_syntax(); builder @@ -69,15 +63,15 @@ impl HighlightingAssets { Ok(HighlightingAssets { syntax_set: syntax_set_builder.build(), theme_set, + fallback_theme: None, }) } - fn from_cache() -> Result { - let theme_set_path = theme_set_path(); - let syntax_set_file = File::open(&syntax_set_path()).chain_err(|| { + pub fn from_cache(theme_set_path: &Path, syntax_set_path: &Path) -> Result { + let syntax_set_file = File::open(syntax_set_path).chain_err(|| { format!( "Could not load cached syntax set '{}'", - syntax_set_path().to_string_lossy() + syntax_set_path.to_string_lossy() ) })?; let syntax_set: SyntaxSet = from_reader(BufReader::new(syntax_set_file)) @@ -95,6 +89,7 @@ impl HighlightingAssets { Ok(HighlightingAssets { syntax_set, theme_set, + fallback_theme: None, }) } @@ -106,18 +101,18 @@ impl HighlightingAssets { from_binary(include_bytes!("../assets/themes.bin")) } - fn from_binary() -> Self { + pub fn from_binary() -> Self { let syntax_set = Self::get_integrated_syntaxset(); let theme_set = Self::get_integrated_themeset(); HighlightingAssets { syntax_set, theme_set, + fallback_theme: None, } } - pub fn save(&self, dir: Option<&Path>) -> Result<()> { - let target_dir = dir.unwrap_or_else(|| PROJECT_DIRS.cache_dir()); + pub fn save_to_cache(&self, target_dir: &Path) -> Result<()> { let _ = fs::create_dir_all(target_dir); let theme_set_path = target_dir.join("themes.bin"); let syntax_set_path = target_dir.join("syntaxes.bin"); @@ -149,22 +144,36 @@ impl HighlightingAssets { Ok(()) } - pub fn get_theme(&self, theme: &str) -> &Theme { + pub fn set_fallback_theme(&mut self, theme: &'static str) { + self.fallback_theme = Some(theme); + } + + pub fn syntaxes(&self) -> &[SyntaxReference] { + self.syntax_set.syntaxes() + } + + pub fn themes(&self) -> impl Iterator { + self.theme_set.themes.keys() + } + + pub(crate) fn get_theme(&self, theme: &str) -> &Theme { match self.theme_set.themes.get(theme) { Some(theme) => theme, None => { - use ansi_term::Colour::Yellow; - eprintln!( - "{}: Unknown theme '{}', using default.", - Yellow.paint("[bat warning]"), - theme - ); - &self.theme_set.themes[BAT_THEME_DEFAULT] + if theme != "" { + use ansi_term::Colour::Yellow; + eprintln!( + "{}: Unknown theme '{}', using default.", + Yellow.paint("[bat warning]"), + theme + ); + } + &self.theme_set.themes[self.fallback_theme.unwrap_or(Self::default_theme())] } } } - pub fn get_syntax( + pub(crate) fn get_syntax( &self, language: Option<&str>, filename: InputFile, @@ -175,25 +184,28 @@ impl HighlightingAssets { (Some(language), _) => self.syntax_set.find_syntax_by_token(language), (None, InputFile::Ordinary(filename)) => { let path = Path::new(filename); + let file_name = path.file_name().and_then(|n| n.to_str()).unwrap_or(""); let extension = path.extension().and_then(|x| x.to_str()).unwrap_or(""); - let file_name = mapping.replace(file_name); - let extension = mapping.replace(extension); - let ext_syntax = self .syntax_set .find_syntax_by_extension(&file_name) .or_else(|| self.syntax_set.find_syntax_by_extension(&extension)); - let line_syntax = if ext_syntax.is_none() { - String::from_utf8(reader.first_line.clone()) - .ok() - .and_then(|l| self.syntax_set.find_syntax_by_first_line(&l)) - } else { - None - }; + let line_syntax = String::from_utf8(reader.first_line.clone()) + .ok() + .and_then(|l| self.syntax_set.find_syntax_by_first_line(&l)); - ext_syntax.or(line_syntax) + let absolute_path = path.canonicalize().ok().unwrap_or(path.to_owned()); + match mapping.get_syntax_for(absolute_path) { + Some(MappingTarget::MapTo(syntax_name)) => { + // TODO: we should probably return an error here if this syntax can not be + // found. Currently, we just fall back to 'plain'. + self.syntax_set.find_syntax_by_name(syntax_name) + } + Some(MappingTarget::MapToUnknown) => line_syntax, + None => ext_syntax.or(line_syntax), + } } (None, InputFile::StdIn) => String::from_utf8(reader.first_line.clone()) .ok() @@ -205,28 +217,120 @@ impl HighlightingAssets { } } -fn theme_set_path() -> PathBuf { - PROJECT_DIRS.cache_dir().join("themes.bin") -} +#[cfg(test)] +mod tests { + use std::ffi::OsStr; + use std::fs::File; + use std::io; + use std::io::Write; -fn syntax_set_path() -> PathBuf { - PROJECT_DIRS.cache_dir().join("syntaxes.bin") -} + use tempdir::TempDir; -pub fn config_dir() -> Cow<'static, str> { - PROJECT_DIRS.config_dir().to_string_lossy() -} + use crate::assets::HighlightingAssets; + use crate::inputfile::InputFile; + use crate::syntax_mapping::{MappingTarget, SyntaxMapping}; -pub fn cache_dir() -> Cow<'static, str> { - PROJECT_DIRS.cache_dir().to_string_lossy() -} + struct SyntaxDetectionTest<'a> { + assets: HighlightingAssets, + pub syntax_mapping: SyntaxMapping<'a>, + temp_dir: TempDir, + } -pub fn clear_assets() { - print!("Clearing theme set cache ... "); - fs::remove_file(theme_set_path()).ok(); - println!("okay"); + impl<'a> SyntaxDetectionTest<'a> { + fn new() -> Self { + SyntaxDetectionTest { + assets: HighlightingAssets::from_binary(), + syntax_mapping: SyntaxMapping::builtin(), + temp_dir: TempDir::new("bat_syntax_detection_tests") + .expect("creation of temporary directory"), + } + } - print!("Clearing syntax set cache ... "); - fs::remove_file(syntax_set_path()).ok(); - println!("okay"); + fn synax_for_file_with_content(&self, file_name: &str, first_line: &str) -> String { + let file_path = self.temp_dir.path().join(file_name); + { + let mut temp_file = File::create(&file_path).unwrap(); + writeln!(temp_file, "{}", first_line).unwrap(); + } + + let input_file = InputFile::Ordinary(OsStr::new(&file_path)); + let syntax = self.assets.get_syntax( + None, + input_file, + &mut input_file.get_reader(&io::stdin()).unwrap(), + &self.syntax_mapping, + ); + + syntax.name.clone() + } + + fn syntax_for_file(&self, file_name: &str) -> String { + self.synax_for_file_with_content(file_name, "") + } + } + + #[test] + fn syntax_detection_basic() { + let test = SyntaxDetectionTest::new(); + + assert_eq!(test.syntax_for_file("test.rs"), "Rust"); + assert_eq!(test.syntax_for_file("test.cpp"), "C++"); + assert_eq!(test.syntax_for_file("test.build"), "NAnt Build File"); + assert_eq!( + test.syntax_for_file("PKGBUILD"), + "Bourne Again Shell (bash)" + ); + assert_eq!(test.syntax_for_file(".bashrc"), "Bourne Again Shell (bash)"); + assert_eq!(test.syntax_for_file("Makefile"), "Makefile"); + } + + #[test] + fn syntax_detection_well_defined_mapping_for_duplicate_extensions() { + let test = SyntaxDetectionTest::new(); + + assert_eq!(test.syntax_for_file("test.h"), "C++"); + assert_eq!(test.syntax_for_file("test.sass"), "Sass"); + assert_eq!(test.syntax_for_file("test.hs"), "Haskell (improved)"); + assert_eq!(test.syntax_for_file("test.js"), "JavaScript (Babel)"); + } + + #[test] + fn syntax_detection_first_line() { + let test = SyntaxDetectionTest::new(); + + assert_eq!( + test.synax_for_file_with_content("my_script", "#!/bin/bash"), + "Bourne Again Shell (bash)" + ); + assert_eq!( + test.synax_for_file_with_content("build", "#!/bin/bash"), + "Bourne Again Shell (bash)" + ); + assert_eq!( + test.synax_for_file_with_content("my_script", " bool { @@ -79,7 +78,7 @@ impl App { pub fn config(&self) -> Result { let files = self.files(); - let output_components = self.output_components()?; + let style_components = self.style_components()?; let paging_mode = match self.matches.value_of("paging") { Some("always") => PagingMode::Always, @@ -105,17 +104,17 @@ impl App { } }; - let mut syntax_mapping = SyntaxMapping::new(); + let mut syntax_mapping = SyntaxMapping::builtin(); if let Some(values) = self.matches.values_of("map-syntax") { for from_to in values { let parts: Vec<_> = from_to.split(':').collect(); if parts.len() != 2 { - 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 ':'. For example: '*.cpp:C++'.".into()); } - syntax_mapping.insert(parts[0], parts[1]); + syntax_mapping.insert(parts[0], MappingTarget::MapTo(parts[1]))?; } } @@ -158,7 +157,7 @@ impl App { Some("character") => OutputWrap::Character, Some("never") => OutputWrap::None, Some("auto") | _ => { - if output_components.plain() { + if style_components.plain() { OutputWrap::None } else { OutputWrap::Character @@ -188,7 +187,7 @@ impl App { .or_else(|| env::var("BAT_TABS").ok()) .and_then(|t| t.parse().ok()) .unwrap_or( - if output_components.plain() && paging_mode == PagingMode::Never { + if style_components.plain() && paging_mode == PagingMode::Never { 0 } else { 4 @@ -201,33 +200,34 @@ impl App { .or_else(|| env::var("BAT_THEME").ok()) .map(|s| { if s == "default" { - String::from(BAT_THEME_DEFAULT) + String::from(HighlightingAssets::default_theme()) } else { s } }) - .unwrap_or_else(|| String::from(BAT_THEME_DEFAULT)), - line_ranges: LineRanges::from( - self.matches - .values_of("line-range") - .map(|vs| vs.map(LineRange::from).collect()) - .transpose()? - .unwrap_or_else(|| vec![]), - ), - output_components, + .unwrap_or_else(|| String::from(HighlightingAssets::default_theme())), + line_ranges: self + .matches + .values_of("line-range") + .map(|vs| vs.map(LineRange::from).collect()) + .transpose()? + .map(LineRanges::from) + .unwrap_or_default(), + style_components, syntax_mapping, pager: self.matches.value_of("pager"), use_italic_text: match self.matches.value_of("italic-text") { Some("always") => true, _ => false, }, - highlight_lines: LineRanges::from( - self.matches - .values_of("highlight-line") - .map(|ws| ws.map(LineRange::from).collect()) - .transpose()? - .unwrap_or_else(|| vec![LineRange { lower: 0, upper: 0 }]), - ), + highlighted_lines: self + .matches + .values_of("highlight-line") + .map(|ws| ws.map(LineRange::from).collect()) + .transpose()? + .map(LineRanges::from) + .map(|lr| HighlightedLineRanges(lr)) + .unwrap_or_default(), filenames: self .matches .values_of("file-name") @@ -252,23 +252,23 @@ impl App { .unwrap_or_else(|| vec![InputFile::StdIn]) } - fn output_components(&self) -> Result { + fn style_components(&self) -> Result { let matches = &self.matches; - Ok(OutputComponents( + Ok(StyleComponents( if matches.value_of("decorations") == Some("never") { HashSet::new() } else if matches.is_present("number") { - [OutputComponent::Numbers].iter().cloned().collect() + [StyleComponent::Numbers].iter().cloned().collect() } else if matches.is_present("plain") { - [OutputComponent::Plain].iter().cloned().collect() + [StyleComponent::Plain].iter().cloned().collect() } else { - let env_style_components: Option> = env::var("BAT_STYLE") + let env_style_components: Option> = env::var("BAT_STYLE") .ok() .map(|style_str| { style_str .split(',') - .map(|x| OutputComponent::from_str(&x)) - .collect::>>() + .map(|x| StyleComponent::from_str(&x)) + .collect::>>() }) .transpose()?; @@ -277,12 +277,12 @@ impl App { .map(|styles| { styles .split(',') - .map(|style| style.parse::()) + .map(|style| style.parse::()) .filter_map(|style| style.ok()) .collect::>() }) .or(env_style_components) - .unwrap_or_else(|| vec![OutputComponent::Full]) + .unwrap_or_else(|| vec![StyleComponent::Full]) .into_iter() .map(|style| style.components(self.interactive_output)) .fold(HashSet::new(), |mut acc, components| { diff --git a/src/bin/bat/assets.rs b/src/bin/bat/assets.rs new file mode 100644 index 00000000..ed07bdb3 --- /dev/null +++ b/src/bin/bat/assets.rs @@ -0,0 +1,38 @@ +use std::borrow::Cow; +use std::fs; +use std::path::PathBuf; + +use crate::directories::PROJECT_DIRS; + +use bat::HighlightingAssets; + +fn theme_set_path() -> PathBuf { + PROJECT_DIRS.cache_dir().join("themes.bin") +} + +fn syntax_set_path() -> PathBuf { + PROJECT_DIRS.cache_dir().join("syntaxes.bin") +} + +pub fn config_dir() -> Cow<'static, str> { + 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() { + print!("Clearing theme set cache ... "); + fs::remove_file(theme_set_path()).ok(); + println!("okay"); + + print!("Clearing syntax set cache ... "); + fs::remove_file(syntax_set_path()).ok(); + println!("okay"); +} + +pub fn assets_from_cache_or_binary() -> HighlightingAssets { + HighlightingAssets::from_cache(&theme_set_path(), &syntax_set_path()) + .unwrap_or(HighlightingAssets::from_binary()) +} diff --git a/src/bin/bat/clap_app.rs b/src/bin/bat/clap_app.rs index 41827cd8..a430b844 100644 --- a/src/bin/bat/clap_app.rs +++ b/src/bin/bat/clap_app.rs @@ -260,13 +260,13 @@ pub fn build_app(interactive_output: bool) -> ClapApp<'static, 'static> { .multiple(true) .takes_value(true) .number_of_values(1) - .value_name("from:to") - .help("Map a file extension or name to an existing syntax.") + .value_name("glob:syntax") + .help("Use the specified syntax for files matching the glob pattern ('*.cpp:C++').") .long_help( - "Map a file extension or file name to an existing syntax (specified by a file \ - extension or file name). For example, to highlight *.build files with the \ - Python syntax, use '-m build:py'. To highlight files named '.myignore' with \ - the Git Ignore syntax, use '-m .myignore:gitignore'.", + "Map a glob pattern to an existing syntax name. The glob pattern is matched \ + on the full path and the filename. For example, to highlight *.build files \ + with the Python syntax, use -m '*.build:Python'. To highlight files named \ + '.myignore' with the Git Ignore syntax, use -m '.myignore:Git Ignore'.", ) .takes_value(true), ) @@ -293,7 +293,7 @@ pub fn build_app(interactive_output: bool) -> ClapApp<'static, 'static> { .arg( Arg::with_name("style") .long("style") - .value_name("style-components") + .value_name("components") // Need to turn this off for overrides_with to work as we want. See the bottom most // example at https://docs.rs/clap/2.32.0/clap/struct.Arg.html#method.overrides_with .use_delimiter(false) diff --git a/src/bin/bat/config.rs b/src/bin/bat/config.rs index 95f76559..b8854844 100644 --- a/src/bin/bat/config.rs +++ b/src/bin/bat/config.rs @@ -5,7 +5,7 @@ use std::path::PathBuf; use shell_words; -use bat::dirs::PROJECT_DIRS; +use crate::directories::PROJECT_DIRS; pub fn config_file() -> PathBuf { env::var("BAT_CONFIG_PATH") diff --git a/src/dirs.rs b/src/bin/bat/directories.rs similarity index 67% rename from src/dirs.rs rename to src/bin/bat/directories.rs index 03cef44d..e57a58c0 100644 --- a/src/dirs.rs +++ b/src/bin/bat/directories.rs @@ -1,8 +1,8 @@ -use crate::dirs_rs; +use std::env; use std::path::{Path, PathBuf}; -#[cfg(target_os = "macos")] -use std::env; +use dirs; +use lazy_static::lazy_static; /// 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 @@ -14,25 +14,16 @@ pub struct BatProjectDirs { impl BatProjectDirs { fn new() -> Option { - #[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"))?; + let cache_dir = BatProjectDirs::get_cache_dir()?; #[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"))); + .or_else(|| dirs::home_dir().map(|d| d.join(".config"))); #[cfg(not(target_os = "macos"))] - let config_dir_op = dirs_rs::config_dir(); + let config_dir_op = dirs::config_dir(); let config_dir = config_dir_op.map(|d| d.join("bat"))?; @@ -42,6 +33,25 @@ impl BatProjectDirs { }) } + pub fn get_cache_dir() -> Option { + // on all OS prefer BAT_CACHE_PATH if set + let cache_dir_op = env::var_os("BAT_CACHE_PATH").map(PathBuf::from); + if cache_dir_op.is_some() { + return cache_dir_op; + } + + #[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::home_dir().map(|d| d.join(".cache"))); + + #[cfg(not(target_os = "macos"))] + let cache_dir_op = dirs::cache_dir(); + + cache_dir_op.map(|d| d.join("bat")) + } + pub fn cache_dir(&self) -> &Path { &self.cache_dir } diff --git a/src/bin/bat/main.rs b/src/bin/bat/main.rs index 17138d05..c759575c 100644 --- a/src/bin/bat/main.rs +++ b/src/bin/bat/main.rs @@ -4,9 +4,13 @@ #[macro_use] extern crate clap; +extern crate dirs as dirs_rs; + mod app; +mod assets; mod clap_app; mod config; +mod directories; use std::collections::HashSet; use std::ffi::OsStr; @@ -19,25 +23,31 @@ use ansi_term::Colour::Green; use ansi_term::Style; use crate::{app::App, config::config_file}; -use bat::controller::Controller; +use assets::{assets_from_cache_or_binary, cache_dir, clear_assets, config_dir}; +use bat::Controller; +use directories::PROJECT_DIRS; use bat::{ - assets::{cache_dir, clear_assets, config_dir, HighlightingAssets}, + config::{Config, InputFile, StyleComponent, StyleComponents}, errors::*, - inputfile::InputFile, - style::{OutputComponent, OutputComponents}, - Config, + HighlightingAssets, }; fn run_cache_subcommand(matches: &clap::ArgMatches) -> Result<()> { if matches.is_present("build") { - let source_dir = matches.value_of("source").map(Path::new); - let target_dir = matches.value_of("target").map(Path::new); + let source_dir = matches + .value_of("source") + .map(Path::new) + .unwrap_or_else(|| PROJECT_DIRS.config_dir()); + let target_dir = matches + .value_of("target") + .map(Path::new) + .unwrap_or_else(|| PROJECT_DIRS.cache_dir()); let blank = matches.is_present("blank"); - let assets = HighlightingAssets::from_files(source_dir, blank)?; - assets.save(target_dir)?; + let assets = HighlightingAssets::from_files(source_dir, !blank)?; + assets.save_to_cache(target_dir)?; } else if matches.is_present("clear") { clear_assets(); } @@ -46,9 +56,8 @@ fn run_cache_subcommand(matches: &clap::ArgMatches) -> Result<()> { } pub fn list_languages(config: &Config) -> Result<()> { - let assets = HighlightingAssets::new(); + let assets = assets_from_cache_or_binary(); let mut languages = assets - .syntax_set .syntaxes() .iter() .filter(|syntax| !syntax.hidden && !syntax.file_extensions.is_empty()) @@ -109,19 +118,18 @@ pub fn list_languages(config: &Config) -> Result<()> { } pub fn list_themes(cfg: &Config) -> Result<()> { - let assets = HighlightingAssets::new(); - let themes = &assets.theme_set.themes; + let assets = assets_from_cache_or_binary(); let mut config = cfg.clone(); let mut style = HashSet::new(); - style.insert(OutputComponent::Plain); + style.insert(StyleComponent::Plain); config.files = vec![InputFile::ThemePreviewFile]; - config.output_components = OutputComponents(style); + config.style_components = StyleComponents(style); let stdout = io::stdout(); let mut stdout = stdout.lock(); if config.colored_output { - for (theme, _) in themes.iter() { + for theme in assets.themes() { writeln!( stdout, "Theme: {}\n", @@ -132,7 +140,7 @@ pub fn list_themes(cfg: &Config) -> Result<()> { writeln!(stdout)?; } } else { - for (theme, _) in themes.iter() { + for theme in assets.themes() { writeln!(stdout, "{}", theme)?; } } @@ -141,7 +149,7 @@ pub fn list_themes(cfg: &Config) -> Result<()> { } fn run_controller(config: &Config) -> Result { - let assets = HighlightingAssets::new(); + let assets = assets_from_cache_or_binary(); let controller = Controller::new(&config, &assets); controller.run() } @@ -199,7 +207,7 @@ fn main() { match result { Err(error) => { - handle_error(&error); + default_error_handler(&error); process::exit(1); } Ok(false) => { diff --git a/src/config.rs b/src/config.rs new file mode 100644 index 00000000..b0d58609 --- /dev/null +++ b/src/config.rs @@ -0,0 +1,96 @@ +pub use crate::inputfile::InputFile; +pub use crate::line_range::{HighlightedLineRanges, LineRange, LineRanges}; +pub use crate::style::{StyleComponent, StyleComponents}; +pub use crate::syntax_mapping::{MappingTarget, SyntaxMapping}; +pub use crate::wrap::OutputWrap; + +#[derive(Debug, Clone, Copy, PartialEq)] +pub enum PagingMode { + Always, + QuitIfOneScreen, + Never, +} + +impl Default for PagingMode { + fn default() -> Self { + PagingMode::Never + } +} + +#[derive(Debug, Clone, Default)] +pub struct Config<'a> { + /// List of files to print + pub files: Vec>, + + /// The explicitly configured language, if any + pub language: Option<&'a str>, + + /// Whether or not to show/replace non-printable characters like space, tab and newline. + pub show_nonprintable: bool, + + /// The character width of the terminal + pub term_width: usize, + + /// The width of tab characters. + /// Currently, a value of 0 will cause tabs to be passed through without expanding them. + pub tab_width: usize, + + /// Whether or not to simply loop through all input (`cat` mode) + pub loop_through: bool, + + /// Whether or not the output should be colorized + pub colored_output: bool, + + /// Whether or not the output terminal supports true color + pub true_color: bool, + + /// Style elements (grid, line numbers, ...) + pub style_components: StyleComponents, + + /// Text wrapping mode + pub output_wrap: OutputWrap, + + /// Pager or STDOUT + pub paging_mode: PagingMode, + + /// Specifies the lines that should be printed + pub line_ranges: LineRanges, + + /// The syntax highlighting theme + pub theme: String, + + /// File extension/name mappings + pub syntax_mapping: SyntaxMapping<'a>, + + /// Command to start the pager + pub pager: Option<&'a str>, + + /// Whether or not to use ANSI italics + pub use_italic_text: bool, + + /// Ranges of lines which should be highlighted with a special background color + pub highlighted_lines: HighlightedLineRanges, + + /// Name of file to display when printing + pub filenames: Option>, +} + +#[test] +fn default_config_should_include_all_lines() { + use crate::line_range::RangeCheckResult; + + assert_eq!( + Config::default().line_ranges.check(17), + RangeCheckResult::InRange + ); +} + +#[test] +fn default_config_should_highlight_no_lines() { + use crate::line_range::RangeCheckResult; + + assert_ne!( + Config::default().highlighted_lines.0.check(17), + RangeCheckResult::InRange + ); +} diff --git a/src/controller.rs b/src/controller.rs index 96633133..21c7f81c 100644 --- a/src/controller.rs +++ b/src/controller.rs @@ -2,12 +2,12 @@ use std::io::{self, Write}; use std::path::Path; use crate::assets::HighlightingAssets; +use crate::config::{Config, PagingMode}; use crate::errors::*; use crate::inputfile::{InputFile, InputFileReader}; use crate::line_range::{LineRanges, RangeCheckResult}; use crate::output::OutputType; use crate::printer::{InteractivePrinter, Printer, SimplePrinter}; -use crate::{Config, PagingMode}; pub struct Controller<'a> { config: &'a Config<'a>, @@ -20,6 +20,10 @@ impl<'b> Controller<'b> { } pub fn run(&self) -> Result { + self.run_with_error_handler(default_error_handler) + } + + pub fn run_with_error_handler(&self, handle_error: impl Fn(&Error)) -> Result { // 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 { @@ -93,7 +97,7 @@ impl<'b> Controller<'b> { input_file: InputFile<'a>, file_name: Option<&str>, ) -> Result<()> { - if !reader.first_line.is_empty() || self.config.output_components.header() { + if !reader.first_line.is_empty() || self.config.style_components.header() { printer.print_header(writer, input_file, file_name)?; } @@ -120,7 +124,7 @@ impl<'b> Controller<'b> { while reader.read_line(&mut line_buffer)? { match line_ranges.check(line_number) { - RangeCheckResult::OutsideRange => { + RangeCheckResult::BeforeOrBetweenRanges => { // Call the printer in case we need to call the syntax highlighter // for this line. However, set `out_of_range` to `true`. printer.print_line(true, writer, line_number, &line_buffer)?; @@ -128,7 +132,7 @@ impl<'b> Controller<'b> { } RangeCheckResult::InRange => { - if self.config.output_components.snip() { + if self.config.style_components.snip() { if first_range { first_range = false; mid_range = true; diff --git a/src/errors.rs b/src/errors.rs new file mode 100644 index 00000000..a0f7e5eb --- /dev/null +++ b/src/errors.rs @@ -0,0 +1,25 @@ +use error_chain::error_chain; + +error_chain! { + foreign_links { + Clap(::clap::Error); + Io(::std::io::Error); + SyntectError(::syntect::LoadingError); + ParseIntError(::std::num::ParseIntError); + GlobParsingError(::globset::Error); + } +} + +pub fn default_error_handler(error: &Error) { + match error { + Error(ErrorKind::Io(ref io_error), _) + if io_error.kind() == ::std::io::ErrorKind::BrokenPipe => + { + ::std::process::exit(0); + } + _ => { + use ansi_term::Colour::Red; + eprintln!("{}: {}", Red.paint("[bat error]"), error); + } + }; +} diff --git a/src/inputfile.rs b/src/inputfile.rs index e79c931d..4a2c6f26 100644 --- a/src/inputfile.rs +++ b/src/inputfile.rs @@ -10,8 +10,8 @@ const THEME_PREVIEW_FILE: &[u8] = include_bytes!("../assets/theme_preview.rs"); pub struct InputFileReader<'a> { inner: Box, - pub first_line: Vec, - pub content_type: Option, + pub(crate) first_line: Vec, + pub(crate) content_type: Option, } impl<'a> InputFileReader<'a> { @@ -36,7 +36,7 @@ impl<'a> InputFileReader<'a> { } } - pub fn read_line(&mut self, buf: &mut Vec) -> io::Result { + pub(crate) fn read_line(&mut self, buf: &mut Vec) -> io::Result { if self.first_line.is_empty() { let res = self.inner.read_until(b'\n', buf).map(|size| size > 0)?; @@ -60,7 +60,7 @@ pub enum InputFile<'a> { } impl<'a> InputFile<'a> { - pub fn get_reader(&self, stdin: &'a io::Stdin) -> Result { + pub(crate) fn get_reader(&self, stdin: &'a io::Stdin) -> Result { match self { InputFile::StdIn => Ok(InputFileReader::new(stdin.lock())), InputFile::Ordinary(filename) => { diff --git a/src/lib.rs b/src/lib.rs index 5723145d..8178f497 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,12 +1,6 @@ // `error_chain!` can recurse deeply #![recursion_limit = "1024"] -#[macro_use] -extern crate error_chain; - -#[macro_use] -extern crate lazy_static; - extern crate ansi_term; extern crate atty; extern crate console; @@ -18,118 +12,23 @@ extern crate shell_words; extern crate syntect; extern crate wild; -pub mod assets; -pub mod controller; +pub(crate) mod assets; +pub mod config; +pub(crate) mod controller; mod decorations; mod diff; -pub mod dirs; -pub mod inputfile; +pub mod errors; +pub(crate) mod inputfile; mod less; -pub mod line_range; +pub(crate) mod line_range; mod output; mod preprocessor; -mod printer; -pub mod style; -pub mod syntax_mapping; +pub(crate) mod printer; +pub(crate) mod style; +pub(crate) mod syntax_mapping; mod terminal; +pub(crate) mod wrap; -pub mod errors { - error_chain! { - foreign_links { - Clap(::clap::Error); - Io(::std::io::Error); - SyntectError(::syntect::LoadingError); - ParseIntError(::std::num::ParseIntError); - } - } - - pub fn handle_error(error: &Error) { - match error { - Error(ErrorKind::Io(ref io_error), _) - if io_error.kind() == ::std::io::ErrorKind::BrokenPipe => - { - ::std::process::exit(0); - } - _ => { - use ansi_term::Colour::Red; - eprintln!("{}: {}", Red.paint("[bat error]"), error); - } - }; - } -} - -#[derive(Debug, Clone, Copy, PartialEq)] -pub enum PagingMode { - Always, - QuitIfOneScreen, - Never, -} - -impl Default for PagingMode { - fn default() -> Self { - PagingMode::Never - } -} - -use inputfile::InputFile; -use line_range::LineRanges; -use style::{OutputComponents, OutputWrap}; -use syntax_mapping::SyntaxMapping; - -#[derive(Debug, Clone, Default)] -pub struct Config<'a> { - /// List of files to print - pub files: Vec>, - - /// The explicitly configured language, if any - pub language: Option<&'a str>, - - /// Whether or not to show/replace non-printable characters like space, tab and newline. - pub show_nonprintable: bool, - - /// The character width of the terminal - pub term_width: usize, - - /// The width of tab characters. - /// Currently, a value of 0 will cause tabs to be passed through without expanding them. - pub tab_width: usize, - - /// Whether or not to simply loop through all input (`cat` mode) - pub loop_through: bool, - - /// Whether or not the output should be colorized - pub colored_output: bool, - - /// Whether or not the output terminal supports true color - pub true_color: bool, - - /// Style elements (grid, line numbers, ...) - pub output_components: OutputComponents, - - /// Text wrapping mode - pub output_wrap: OutputWrap, - - /// Pager or STDOUT - pub paging_mode: PagingMode, - - /// Specifies the lines that should be printed - pub line_ranges: LineRanges, - - /// The syntax highlighting theme - pub theme: String, - - /// File extension/name mappings - pub syntax_mapping: SyntaxMapping, - - /// Command to start the pager - pub pager: Option<&'a str>, - - /// Whether or not to use ANSI italics - pub use_italic_text: bool, - - /// Lines to highlight - pub highlight_lines: LineRanges, - - /// Name of file to display when printing - pub filenames: Option>, -} +pub use assets::HighlightingAssets; +pub use controller::Controller; +pub use printer::{InteractivePrinter, Printer, SimplePrinter}; diff --git a/src/line_range.rs b/src/line_range.rs index 5dfbd3b3..b7cfee5f 100644 --- a/src/line_range.rs +++ b/src/line_range.rs @@ -6,20 +6,22 @@ pub struct LineRange { pub upper: usize, } -impl LineRange { - pub fn from(range_raw: &str) -> Result { - LineRange::parse_range(range_raw) - } - - pub fn new() -> LineRange { +impl Default for LineRange { + fn default() -> LineRange { LineRange { lower: usize::min_value(), upper: usize::max_value(), } } +} - pub fn parse_range(range_raw: &str) -> Result { - let mut new_range = LineRange::new(); +impl LineRange { + pub fn from(range_raw: &str) -> Result { + LineRange::parse_range(range_raw) + } + + fn parse_range(range_raw: &str) -> Result { + let mut new_range = LineRange::default(); if range_raw.bytes().nth(0).ok_or("Empty line range")? == b':' { new_range.upper = range_raw[1..].parse()?; @@ -48,7 +50,7 @@ impl LineRange { } } - pub fn is_inside(&self, line: usize) -> bool { + pub(crate) fn is_inside(&self, line: usize) -> bool { line >= self.lower && line <= self.upper } } @@ -97,19 +99,27 @@ pub enum RangeCheckResult { InRange, // Before the first range or within two ranges - OutsideRange, + BeforeOrBetweenRanges, // Line number is outside of all ranges and larger than the last range. AfterLastRange, } -#[derive(Debug, Clone, Default)] +#[derive(Debug, Clone)] pub struct LineRanges { ranges: Vec, largest_upper_bound: usize, } impl LineRanges { + pub fn none() -> LineRanges { + LineRanges::from(vec![]) + } + + pub fn all() -> LineRanges { + LineRanges::from(vec![LineRange::default()]) + } + pub fn from(ranges: Vec) -> LineRanges { let largest_upper_bound = ranges .iter() @@ -122,17 +132,32 @@ impl LineRanges { } } - pub fn check(&self, line: usize) -> RangeCheckResult { - if self.ranges.is_empty() | self.ranges.iter().any(|r| r.is_inside(line)) { + pub(crate) fn check(&self, line: usize) -> RangeCheckResult { + if self.ranges.iter().any(|r| r.is_inside(line)) { RangeCheckResult::InRange } else if line < self.largest_upper_bound { - RangeCheckResult::OutsideRange + RangeCheckResult::BeforeOrBetweenRanges } else { RangeCheckResult::AfterLastRange } } } +impl Default for LineRanges { + fn default() -> Self { + Self::all() + } +} + +#[derive(Debug, Clone)] +pub struct HighlightedLineRanges(pub LineRanges); + +impl Default for HighlightedLineRanges { + fn default() -> Self { + HighlightedLineRanges(LineRanges::none()) + } +} + #[cfg(test)] fn ranges(rs: &[&str]) -> LineRanges { LineRanges::from(rs.iter().map(|r| LineRange::from(r).unwrap()).collect()) @@ -142,7 +167,7 @@ fn ranges(rs: &[&str]) -> LineRanges { fn test_ranges_simple() { let ranges = ranges(&["3:8"]); - assert_eq!(RangeCheckResult::OutsideRange, ranges.check(2)); + assert_eq!(RangeCheckResult::BeforeOrBetweenRanges, ranges.check(2)); assert_eq!(RangeCheckResult::InRange, ranges.check(5)); assert_eq!(RangeCheckResult::AfterLastRange, ranges.check(9)); } @@ -151,11 +176,11 @@ fn test_ranges_simple() { fn test_ranges_advanced() { let ranges = ranges(&["3:8", "11:20", "25:30"]); - assert_eq!(RangeCheckResult::OutsideRange, ranges.check(2)); + assert_eq!(RangeCheckResult::BeforeOrBetweenRanges, ranges.check(2)); assert_eq!(RangeCheckResult::InRange, ranges.check(5)); - assert_eq!(RangeCheckResult::OutsideRange, ranges.check(9)); + assert_eq!(RangeCheckResult::BeforeOrBetweenRanges, ranges.check(9)); assert_eq!(RangeCheckResult::InRange, ranges.check(11)); - assert_eq!(RangeCheckResult::OutsideRange, ranges.check(22)); + assert_eq!(RangeCheckResult::BeforeOrBetweenRanges, ranges.check(22)); assert_eq!(RangeCheckResult::InRange, ranges.check(28)); assert_eq!(RangeCheckResult::AfterLastRange, ranges.check(31)); } @@ -174,15 +199,22 @@ fn test_ranges_open_low() { fn test_ranges_open_high() { let ranges = ranges(&["3:", "2:5"]); - assert_eq!(RangeCheckResult::OutsideRange, ranges.check(1)); + assert_eq!(RangeCheckResult::BeforeOrBetweenRanges, ranges.check(1)); assert_eq!(RangeCheckResult::InRange, ranges.check(3)); assert_eq!(RangeCheckResult::InRange, ranges.check(5)); assert_eq!(RangeCheckResult::InRange, ranges.check(9)); } #[test] -fn test_ranges_empty() { - let ranges = ranges(&[]); +fn test_ranges_all() { + let ranges = LineRanges::all(); assert_eq!(RangeCheckResult::InRange, ranges.check(1)); } + +#[test] +fn test_ranges_none() { + let ranges = LineRanges::none(); + + assert_ne!(RangeCheckResult::InRange, ranges.check(1)); +} diff --git a/src/output.rs b/src/output.rs index 081cb160..3bad301b 100644 --- a/src/output.rs +++ b/src/output.rs @@ -6,9 +6,9 @@ use std::process::{Child, Command, Stdio}; use shell_words; +use crate::config::PagingMode; use crate::errors::*; use crate::less::retrieve_less_version; -use crate::PagingMode; #[derive(Debug)] pub enum OutputType { diff --git a/src/printer.rs b/src/printer.rs index 64d42d1d..3924cd62 100644 --- a/src/printer.rs +++ b/src/printer.rs @@ -20,6 +20,7 @@ use encoding::{DecoderTrap, Encoding}; use unicode_width::UnicodeWidthChar; use crate::assets::HighlightingAssets; +use crate::config::Config; use crate::decorations::{ Decoration, GridBorderDecoration, LineChangesDecoration, LineNumberDecoration, }; @@ -29,9 +30,8 @@ use crate::errors::*; use crate::inputfile::{InputFile, InputFileReader}; use crate::line_range::RangeCheckResult; use crate::preprocessor::{expand_tabs, replace_nonprintable}; -use crate::style::OutputWrap; use crate::terminal::{as_terminal_escaped, to_ansi_color}; -use crate::Config; +use crate::wrap::OutputWrap; pub trait Printer { fn print_header( @@ -126,11 +126,11 @@ impl<'a> InteractivePrinter<'a> { // Create decorations. let mut decorations: Vec> = Vec::new(); - if config.output_components.numbers() { + if config.style_components.numbers() { decorations.push(Box::new(LineNumberDecoration::new(&colors))); } - if config.output_components.changes() { + if config.style_components.changes() { decorations.push(Box::new(LineChangesDecoration::new(&colors))); } @@ -140,7 +140,7 @@ impl<'a> InteractivePrinter<'a> { // The grid border decoration isn't added until after the panel_width calculation, since the // print_horizontal_line, print_header, and print_footer functions all assume the panel // width is without the grid border. - if config.output_components.grid() && !decorations.is_empty() { + if config.style_components.grid() && !decorations.is_empty() { decorations.push(Box::new(GridBorderDecoration::new(&colors))); } @@ -162,7 +162,7 @@ impl<'a> InteractivePrinter<'a> { None } else { // Get the Git modifications - line_changes = if config.output_components.changes() { + line_changes = if config.style_components.changes() { match file { InputFile::Ordinary(filename) => get_git_diff(filename), _ => None, @@ -216,7 +216,7 @@ impl<'a> InteractivePrinter<'a> { text_truncated, " ".repeat(self.panel_width - 1 - text_truncated.len()) ); - if self.config.output_components.grid() { + if self.config.style_components.grid() { format!("{} │ ", text_filled) } else { format!("{}", text_filled) @@ -240,7 +240,7 @@ impl<'a> Printer for InteractivePrinter<'a> { file: InputFile, file_name: Option<&str>, ) -> Result<()> { - if !self.config.output_components.header() { + if !self.config.style_components.header() { if Some(ContentType::BINARY) == self.content_type && !self.config.show_nonprintable { let input = match file { InputFile::Ordinary(filename) => format!( @@ -259,14 +259,14 @@ impl<'a> Printer for InteractivePrinter<'a> { input )?; } else { - if self.config.output_components.grid() { + if self.config.style_components.grid() { self.print_horizontal_line(handle, '┬')?; } } return Ok(()); } - if self.config.output_components.grid() { + if self.config.style_components.grid() { self.print_horizontal_line(handle, '┬')?; write!( @@ -305,7 +305,7 @@ impl<'a> Printer for InteractivePrinter<'a> { mode )?; - if self.config.output_components.grid() { + if self.config.style_components.grid() { if self.content_type.map_or(false, |c| c.is_text()) || self.config.show_nonprintable { self.print_horizontal_line(handle, '┼')?; } else { @@ -317,7 +317,7 @@ impl<'a> Printer for InteractivePrinter<'a> { } fn print_footer(&mut self, handle: &mut dyn Write) -> Result<()> { - if self.config.output_components.grid() + if self.config.style_components.grid() && (self.content_type.map_or(false, |c| c.is_text()) || self.config.show_nonprintable) { self.print_horizontal_line(handle, '┴') @@ -395,7 +395,7 @@ impl<'a> Printer for InteractivePrinter<'a> { // Line highlighting let highlight_this_line = - self.config.highlight_lines.check(line_number) == RangeCheckResult::InRange; + self.config.highlighted_lines.0.check(line_number) == RangeCheckResult::InRange; let background_color = self .background_color_highlight diff --git a/src/style.rs b/src/style.rs index e06bba79..a906553a 100644 --- a/src/style.rs +++ b/src/style.rs @@ -4,7 +4,7 @@ use std::str::FromStr; use crate::errors::*; #[derive(Debug, Eq, PartialEq, Copy, Clone, Hash)] -pub enum OutputComponent { +pub enum StyleComponent { Auto, Changes, Grid, @@ -15,92 +15,80 @@ pub enum OutputComponent { Plain, } -#[derive(Debug, Eq, PartialEq, Copy, Clone, Hash)] -pub enum OutputWrap { - Character, - None, -} - -impl Default for OutputWrap { - fn default() -> Self { - OutputWrap::None - } -} - -impl OutputComponent { - pub fn components(self, interactive_terminal: bool) -> &'static [OutputComponent] { +impl StyleComponent { + pub fn components(self, interactive_terminal: bool) -> &'static [StyleComponent] { match self { - OutputComponent::Auto => { + StyleComponent::Auto => { if interactive_terminal { - OutputComponent::Full.components(interactive_terminal) + StyleComponent::Full.components(interactive_terminal) } else { - OutputComponent::Plain.components(interactive_terminal) + StyleComponent::Plain.components(interactive_terminal) } } - OutputComponent::Changes => &[OutputComponent::Changes], - OutputComponent::Grid => &[OutputComponent::Grid], - OutputComponent::Header => &[OutputComponent::Header], - OutputComponent::Numbers => &[OutputComponent::Numbers], - OutputComponent::Snip => &[OutputComponent::Snip], - OutputComponent::Full => &[ - OutputComponent::Changes, - OutputComponent::Grid, - OutputComponent::Header, - OutputComponent::Numbers, - OutputComponent::Snip, + StyleComponent::Changes => &[StyleComponent::Changes], + StyleComponent::Grid => &[StyleComponent::Grid], + StyleComponent::Header => &[StyleComponent::Header], + StyleComponent::Numbers => &[StyleComponent::Numbers], + StyleComponent::Snip => &[StyleComponent::Snip], + StyleComponent::Full => &[ + StyleComponent::Changes, + StyleComponent::Grid, + StyleComponent::Header, + StyleComponent::Numbers, + StyleComponent::Snip, ], - OutputComponent::Plain => &[], + StyleComponent::Plain => &[], } } } -impl FromStr for OutputComponent { +impl FromStr for StyleComponent { type Err = Error; fn from_str(s: &str) -> Result { match s { - "auto" => Ok(OutputComponent::Auto), - "changes" => Ok(OutputComponent::Changes), - "grid" => Ok(OutputComponent::Grid), - "header" => Ok(OutputComponent::Header), - "numbers" => Ok(OutputComponent::Numbers), - "snip" => Ok(OutputComponent::Snip), - "full" => Ok(OutputComponent::Full), - "plain" => Ok(OutputComponent::Plain), + "auto" => Ok(StyleComponent::Auto), + "changes" => Ok(StyleComponent::Changes), + "grid" => Ok(StyleComponent::Grid), + "header" => Ok(StyleComponent::Header), + "numbers" => Ok(StyleComponent::Numbers), + "snip" => Ok(StyleComponent::Snip), + "full" => Ok(StyleComponent::Full), + "plain" => Ok(StyleComponent::Plain), _ => Err(format!("Unknown style '{}'", s).into()), } } } #[derive(Debug, Clone, Default)] -pub struct OutputComponents(pub HashSet); +pub struct StyleComponents(pub HashSet); -impl OutputComponents { - pub fn new(components: &[OutputComponent]) -> OutputComponents { - OutputComponents(components.iter().cloned().collect()) +impl StyleComponents { + pub fn new(components: &[StyleComponent]) -> StyleComponents { + StyleComponents(components.iter().cloned().collect()) } pub fn changes(&self) -> bool { - self.0.contains(&OutputComponent::Changes) + self.0.contains(&StyleComponent::Changes) } pub fn grid(&self) -> bool { - self.0.contains(&OutputComponent::Grid) + self.0.contains(&StyleComponent::Grid) } pub fn header(&self) -> bool { - self.0.contains(&OutputComponent::Header) + self.0.contains(&StyleComponent::Header) } pub fn numbers(&self) -> bool { - self.0.contains(&OutputComponent::Numbers) + self.0.contains(&StyleComponent::Numbers) } pub fn snip(&self) -> bool { - self.0.contains(&OutputComponent::Snip) + self.0.contains(&StyleComponent::Snip) } pub fn plain(&self) -> bool { - self.0.iter().all(|c| c == &OutputComponent::Plain) + self.0.iter().all(|c| c == &StyleComponent::Plain) } } diff --git a/src/syntax_mapping.rs b/src/syntax_mapping.rs index 3126ac9c..72cb021c 100644 --- a/src/syntax_mapping.rs +++ b/src/syntax_mapping.rs @@ -1,35 +1,111 @@ -use std::borrow::Cow; -use std::collections::HashMap; +use std::path::Path; + +use crate::errors::Result; + +use globset::{Candidate, GlobBuilder, GlobMatcher}; + +#[derive(Debug, Clone, Copy, PartialEq)] +pub enum MappingTarget<'a> { + MapTo(&'a str), + MapToUnknown, +} #[derive(Debug, Clone, Default)] -pub struct SyntaxMapping(HashMap); +pub struct SyntaxMapping<'a> { + mappings: Vec<(GlobMatcher, MappingTarget<'a>)>, +} -impl SyntaxMapping { - pub fn new() -> SyntaxMapping { +impl<'a> SyntaxMapping<'a> { + pub fn empty() -> SyntaxMapping<'a> { Default::default() } - pub fn insert(&mut self, from: impl Into, to: impl Into) -> Option { - self.0.insert(from.into(), to.into()) + pub fn builtin() -> SyntaxMapping<'a> { + let mut mapping = Self::empty(); + mapping.insert("*.h", MappingTarget::MapTo("C++")).unwrap(); + mapping + .insert("build", MappingTarget::MapToUnknown) + .unwrap(); + mapping + .insert("**/.ssh/config", MappingTarget::MapTo("SSH Config")) + .unwrap(); + mapping + .insert( + "/etc/profile", + MappingTarget::MapTo("Bourne Again Shell (bash)"), + ) + .unwrap(); + + mapping } - pub fn replace<'a>(&self, input: impl Into>) -> Cow<'a, str> { - let input = input.into(); - match self.0.get(input.as_ref()) { - Some(s) => Cow::from(s.clone()), - None => input, + pub fn insert(&mut self, from: &str, to: MappingTarget<'a>) -> Result<()> { + let glob = GlobBuilder::new(from) + .case_insensitive(false) + .literal_separator(true) + .build()?; + self.mappings.push((glob.compile_matcher(), to)); + Ok(()) + } + + pub(crate) fn get_syntax_for(&self, path: impl AsRef) -> Option> { + let candidate = Candidate::new(path.as_ref()); + let canddidate_filename = path.as_ref().file_name().map(Candidate::new); + for (ref glob, ref syntax) in self.mappings.iter().rev() { + if glob.is_match_candidate(&candidate) + || canddidate_filename + .as_ref() + .map_or(false, |filename| glob.is_match_candidate(filename)) + { + return Some(*syntax); + } } + None } } #[test] fn basic() { - let mut map = SyntaxMapping::new(); - map.insert("Cargo.lock", "toml"); - map.insert(".ignore", ".gitignore"); + let mut map = SyntaxMapping::empty(); + map.insert("/path/to/Cargo.lock", MappingTarget::MapTo("TOML")) + .ok(); + map.insert("/path/to/.ignore", MappingTarget::MapTo("Git Ignore")) + .ok(); - assert_eq!("toml", map.replace("Cargo.lock")); - assert_eq!("other.lock", map.replace("other.lock")); + assert_eq!( + map.get_syntax_for("/path/to/Cargo.lock"), + Some(MappingTarget::MapTo("TOML")) + ); + assert_eq!(map.get_syntax_for("/path/to/other.lock"), None); - assert_eq!(".gitignore", map.replace(".ignore")); + assert_eq!( + map.get_syntax_for("/path/to/.ignore"), + Some(MappingTarget::MapTo("Git Ignore")) + ); +} + +#[test] +fn user_can_override_builtin_mappings() { + let mut map = SyntaxMapping::builtin(); + + assert_eq!( + map.get_syntax_for("/etc/profile"), + Some(MappingTarget::MapTo("Bourne Again Shell (bash)")) + ); + map.insert("/etc/profile", MappingTarget::MapTo("My Syntax")) + .ok(); + assert_eq!( + map.get_syntax_for("/etc/profile"), + Some(MappingTarget::MapTo("My Syntax")) + ); +} + +#[test] +fn builtin_mappings() { + let map = SyntaxMapping::builtin(); + + assert_eq!( + map.get_syntax_for("/path/to/build"), + Some(MappingTarget::MapToUnknown) + ); } diff --git a/src/wrap.rs b/src/wrap.rs new file mode 100644 index 00000000..211469ab --- /dev/null +++ b/src/wrap.rs @@ -0,0 +1,11 @@ +#[derive(Debug, Eq, PartialEq, Copy, Clone, Hash)] +pub enum OutputWrap { + Character, + None, +} + +impl Default for OutputWrap { + fn default() -> Self { + OutputWrap::None + } +} diff --git a/tests/no_duplicate_extensions.rs b/tests/no_duplicate_extensions.rs new file mode 100644 index 00000000..20dfc349 --- /dev/null +++ b/tests/no_duplicate_extensions.rs @@ -0,0 +1,35 @@ +use std::collections::HashSet; + +use bat::HighlightingAssets; + +#[test] +fn no_duplicate_extensions() { + const KNOWN_EXCEPTIONS: &[&'static str] = &[ + // The '.h' extension currently appears in multiple syntaxes: C, C++, Objective C, + // Objective C++ + "h", + // In addition to the standard Haskell syntax in 'Packages', we also ship the 'Cabal' + // syntax which comes with a "Haskell (improved)" syntax. + "hs", + // In addition to the standard JavaScript syntax in 'Packages', we also ship the + // 'Javascript (Babel)' syntax. + "js", + // The "Ruby Haml" syntax also comes with a '.sass' extension. However, we make sure + // that 'sass' is mapped to the 'Sass' syntax. + "sass", + ]; + + let assets = HighlightingAssets::from_binary(); + + let mut extensions = HashSet::new(); + + for syntax in assets.syntaxes() { + for extension in &syntax.file_extensions { + assert!( + KNOWN_EXCEPTIONS.contains(&extension.as_str()) || extensions.insert(extension), + "File extension / pattern \"{}\" appears twice in the syntax set", + extension + ); + } + } +} diff --git a/tests/syntax_detection.rs b/tests/syntax_detection.rs deleted file mode 100644 index 23a52de9..00000000 --- a/tests/syntax_detection.rs +++ /dev/null @@ -1,78 +0,0 @@ -use std::ffi::OsStr; -use std::fs::File; -use std::io; -use std::io::Write; - -use tempdir::TempDir; - -use bat::assets::HighlightingAssets; -use bat::inputfile::InputFile; -use bat::syntax_mapping::SyntaxMapping; - -struct SyntaxDetectionTest { - assets: HighlightingAssets, - pub syntax_mapping: SyntaxMapping, - temp_dir: TempDir, -} - -impl SyntaxDetectionTest { - fn new() -> Self { - SyntaxDetectionTest { - assets: HighlightingAssets::new(), - syntax_mapping: SyntaxMapping::new(), - temp_dir: TempDir::new("bat_syntax_detection_tests") - .expect("creation of temporary directory"), - } - } - - fn syntax_name_with_content(&self, file_name: &str, first_line: &str) -> String { - let file_path = self.temp_dir.path().join(file_name); - { - let mut temp_file = File::create(&file_path).unwrap(); - writeln!(temp_file, "{}", first_line).unwrap(); - } - - let input_file = InputFile::Ordinary(OsStr::new(&file_path)); - let syntax = self.assets.get_syntax( - None, - input_file, - &mut input_file.get_reader(&io::stdin()).unwrap(), - &self.syntax_mapping, - ); - - syntax.name.clone() - } - - fn syntax_name(&self, file_name: &str) -> String { - self.syntax_name_with_content(file_name, "") - } -} - -#[test] -fn syntax_detection_basic() { - let test = SyntaxDetectionTest::new(); - - assert_eq!(test.syntax_name("test.rs"), "Rust"); - assert_eq!(test.syntax_name("test.cpp"), "C++"); - assert_eq!(test.syntax_name("PKGBUILD"), "Bourne Again Shell (bash)"); -} - -#[test] -fn syntax_detection_first_line() { - let test = SyntaxDetectionTest::new(); - - assert_eq!( - test.syntax_name_with_content("my_script", "#!/bin/bash"), - "Bourne Again Shell (bash)" - ); - assert_eq!(test.syntax_name_with_content("my_script", "