1
0
mirror of https://github.com/sharkdp/bat synced 2026-08-03 18:51:44 +00:00

Compare commits

..

138 Commits

Author SHA1 Message Date
dependabot[bot] 9411fb2b0e build(deps): bump assets/syntaxes/02_Extra/TOML
Bumps [assets/syntaxes/02_Extra/TOML](https://github.com/jasonwilliams/sublime_toml_highlighting) from `f5a57e8` to `f3a8d6e`.
- [Release notes](https://github.com/jasonwilliams/sublime_toml_highlighting/releases)
- [Commits](https://github.com/jasonwilliams/sublime_toml_highlighting/compare/f5a57e8bff694a4e6c52a491dae579aabc7427cf...f3a8d6eb3c5fb9587ed992e384131b84c9619d6a)

---
updated-dependencies:
- dependency-name: assets/syntaxes/02_Extra/TOML
  dependency-version: f3a8d6eb3c5fb9587ed992e384131b84c9619d6a
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-01 03:03:44 +00:00
Keith Hall 885ae1dc81 Merge pull request #3561 from cerdelen/small_typo_fix
Small typo fixes
2026-01-28 22:03:09 +02:00
Cedric Erdelen f6f1f18e9c remove trailing whitespace 2026-01-28 19:59:10 +01:00
cerdelen 69a2ffbdac Update src/config.rs
Co-authored-by: Keith Hall <keith-hall@users.noreply.github.com>
2026-01-28 19:48:02 +01:00
Cedric Erdelen 6b8decf2a4 Small typo fixes 2026-01-28 14:12:32 +01:00
Keith Hall cd06fe46e0 Merge pull request #3552 from CosmicHorrorDev/remove-vs-dark+
Remove Visual Studio Dark+ theme
2026-01-15 22:13:41 +02:00
Cosmic Horror 099d716455 Remove Visual Studio Dark+ theme 2026-01-14 21:13:44 -07:00
auto-merge-dependabot-prs[bot] 298e1f5321 Merge pull request #3506 from sharkdp/dependabot/github_actions/actions/checkout-6
build(deps): bump actions/checkout from 5 to 6
2026-01-12 05:14:43 +00:00
dependabot[bot] 3cb55e85d0 build(deps): bump actions/checkout from 5 to 6
Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-01-12 06:04:14 +01:00
Keith Hall 981f25989a Merge pull request #3550 from nmacl/master
Use cargo_bin! macro to fix tests for future Cargo versions
2026-01-10 13:53:09 +02:00
Your Name 57bf8ff7da Update changelog with PR number 2026-01-08 09:45:41 -05:00
Your Name 31f982e736 Fixed formatting 2026-01-08 09:42:42 -05:00
Your Name 0a97a1edd7 Add changelog entry 2026-01-08 09:35:01 -05:00
Your Name 6c75acfffc Replace deprecated cargo_bin with cargo_bin! macro
The old Command::cargo_bin() is deprecated and will break when Cargo
changes build directory layout. Updated to use cargo_bin!() macro instead.

Bumped assert_cmd to 2.0.16 to get the new macro.

Fixes #3528
2026-01-08 09:28:11 -05:00
auto-merge-dependabot-prs[bot] 4e84e838a3 Merge pull request #3544 from sharkdp/dependabot/cargo/shell-words-1.1.1
build(deps): bump shell-words from 1.1.0 to 1.1.1
2026-01-01 04:33:25 +00:00
dependabot[bot] d48bf240a7 build(deps): bump shell-words from 1.1.0 to 1.1.1
Bumps [shell-words](https://github.com/tmiasko/shell-words) from 1.1.0 to 1.1.1.
- [Commits](https://github.com/tmiasko/shell-words/compare/v1.1.0...v1.1.1)

---
updated-dependencies:
- dependency-name: shell-words
  dependency-version: 1.1.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-01-01 04:20:47 +00:00
auto-merge-dependabot-prs[bot] 7dc180eefb Merge pull request #3542 from sharkdp/dependabot/cargo/console-0.16.2
build(deps): bump console from 0.16.1 to 0.16.2
2026-01-01 04:18:01 +00:00
dependabot[bot] 3276e9469a build(deps): bump console from 0.16.1 to 0.16.2
Bumps [console](https://github.com/console-rs/console) from 0.16.1 to 0.16.2.
- [Release notes](https://github.com/console-rs/console/releases)
- [Changelog](https://github.com/console-rs/console/blob/main/CHANGELOG.md)
- [Commits](https://github.com/console-rs/console/compare/0.16.1...0.16.2)

---
updated-dependencies:
- dependency-name: console
  dependency-version: 0.16.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-01-01 04:03:19 +00:00
auto-merge-dependabot-prs[bot] 60902c796f Merge pull request #3541 from sharkdp/dependabot/cargo/nu-ansi-term-0.50.3
build(deps): bump nu-ansi-term from 0.50.1 to 0.50.3
2026-01-01 04:00:33 +00:00
dependabot[bot] c12cdcace3 build(deps): bump nu-ansi-term from 0.50.1 to 0.50.3
Bumps [nu-ansi-term](https://github.com/nushell/nu-ansi-term) from 0.50.1 to 0.50.3.
- [Release notes](https://github.com/nushell/nu-ansi-term/releases)
- [Changelog](https://github.com/nushell/nu-ansi-term/blob/main/CHANGELOG.md)
- [Commits](https://github.com/nushell/nu-ansi-term/compare/v0.50.1...v0.50.3)

---
updated-dependencies:
- dependency-name: nu-ansi-term
  dependency-version: 0.50.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-01-01 03:19:08 +00:00
auto-merge-dependabot-prs[bot] 823fd9f5c6 Merge pull request #3539 from sharkdp/dependabot/cargo/tempfile-3.23.0
build(deps): bump tempfile from 3.16.0 to 3.23.0
2026-01-01 03:15:20 +00:00
dependabot[bot] 88d6fd0248 build(deps): bump tempfile from 3.16.0 to 3.23.0
Bumps [tempfile](https://github.com/Stebalien/tempfile) from 3.16.0 to 3.23.0.
- [Changelog](https://github.com/Stebalien/tempfile/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Stebalien/tempfile/compare/v3.16.0...v3.23.0)

---
updated-dependencies:
- dependency-name: tempfile
  dependency-version: 3.23.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-01-01 03:02:10 +00:00
Keith Hall 32047346e3 Merge pull request #3534 from ltrzesniewski/windows-clone
Make the repository clone correctly under Windows
2025-12-28 08:02:56 +02:00
Lucas Trzesniewski 56678dc771 Change the Jinja2 fork URL 2025-12-28 07:53:27 +02:00
Lucas Trzesniewski b34a1e0cc2 Make the repository clone correctly under Windows 2025-12-28 07:53:27 +02:00
Keith Hall 41f55bf902 Merge pull request #3535 from ltrzesniewski/windows-build
Fix integration tests on Windows
2025-12-28 07:46:13 +02:00
Lucas Trzesniewski c8514543af Fix integration tests on Windows 2025-12-27 21:17:40 +01:00
Hakil ad608014d9 fix issue #3526 (#3529) 2025-12-23 19:08:38 +02:00
Keith Hall 9bf344f760 Merge pull request #3517 from akirk/strip-overstriking
Improve native man pages and command help syntax highlighting by stripping overstriking
2025-12-11 08:36:18 +02:00
Alex Kirk 4db185834b Update changelog 2025-12-11 06:12:44 +01:00
Alex Kirk 4549ab3f22 Move the strip_overstrike check 2025-12-11 06:06:07 +01:00
Alex Kirk 629a8968fc Remove unnecessary code change 2025-12-11 05:54:30 +01:00
Alex Kirk de414ed631 Limit overstrike stripping to man pages and help 2025-12-11 05:49:46 +01:00
Alex Kirk 59c5896902 Simplify MANPAGER guide 2025-12-11 05:49:46 +01:00
Alex Kirk b22fc5db6b Add show-all integration test 2025-12-11 05:49:46 +01:00
Alex Kirk f97f9ebf03 Remove double backspace scan 2025-12-11 05:49:46 +01:00
Alex Kirk 64a4b204a2 Only strip overstrike when a syntax highlighting theme is used 2025-12-11 05:49:46 +01:00
Alex Kirk 5fb8a25c30 Performance optimization 2025-12-11 05:49:46 +01:00
Alex Kirk 80ef6832d3 Add a changelog entry 2025-12-11 05:49:46 +01:00
Alex Kirk 51bdaa5f88 Strip overstriking to better support man pages 2025-12-11 05:49:46 +01:00
Keith Hall eb2a8e29c7 Merge pull request #3524 from sharkdp/help_custom_assets
Support custom assets (themes) when displaying help output
2025-12-10 22:39:51 +02:00
Keith Hall b7dd88eafd Support custom assets (themes) when displaying help output 2025-12-10 22:30:01 +02:00
Keith Hall 79fe5fea63 Merge pull request #3521 from sharkdp/rainbow_csv_strings
[CSV] don't apply string highlighting by default
2025-12-08 20:08:04 +02:00
Keith Hall d15e399fce [CSV] don't apply string highlighting by default 2025-12-07 21:55:05 +02:00
Keith Hall 4d188e45fe Merge pull request #3519 from sorairolake/change-zig-url
chore: Change URL of Zig submodule from GitHub to Codeberg
2025-12-06 13:18:58 +02:00
Shun Sakai abce6ac0d1 chore: Change URL of Zig submodule 2025-12-06 12:00:48 +09:00
Keith Hall 566595f0eb Merge pull request #3516 from sharkdp/fix_help_builtin_pager
Fix --help --pager=builtin
2025-12-05 22:22:22 +02:00
Keith Hall 1796324531 Fix --help --pager=builtin
Previously it still used less
2025-12-04 21:53:45 +02:00
David Peter 2371077352 Update sponsors section (#3514)
Removed Graphite sponsorship information from README.
2025-12-04 09:29:18 +01:00
Keith Hall 7e7ab8a860 Merge pull request #3511 from sharkdp/prepare_changelog
add empty changelog sections ready for future changes
2025-12-03 22:48:16 +02:00
Keith Hall c054541776 add empty changelog sections ready for future changes 2025-12-03 22:37:26 +02:00
auto-merge-dependabot-prs[bot] d6ffe3a9be Merge pull request #3503 from sharkdp/dependabot/cargo/execute-0.2.15
build(deps): bump execute from 0.2.13 to 0.2.15
2025-12-02 22:34:27 +00:00
dependabot[bot] 4a1ceb3ce0 build(deps): bump execute from 0.2.13 to 0.2.15
Bumps [execute](https://github.com/magiclen/execute) from 0.2.13 to 0.2.15.
- [Commits](https://github.com/magiclen/execute/compare/v0.2.13...v0.2.15)

---
updated-dependencies:
- dependency-name: execute
  dependency-version: 0.2.15
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-02 22:24:11 +00:00
auto-merge-dependabot-prs[bot] 45a6ee95d5 Merge pull request #3505 from sharkdp/dependabot/cargo/toml-0.9.8
build(deps): bump toml from 0.9.1 to 0.9.8
2025-12-02 22:21:11 +00:00
dependabot[bot] 3eeaf29675 build(deps): bump toml from 0.9.1 to 0.9.8
Bumps [toml](https://github.com/toml-rs/toml) from 0.9.1 to 0.9.8.
- [Commits](https://github.com/toml-rs/toml/compare/toml-v0.9.1...toml-v0.9.8)

---
updated-dependencies:
- dependency-name: toml
  dependency-version: 0.9.8
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-02 22:06:24 +00:00
auto-merge-dependabot-prs[bot] 58d1fa83e9 Merge pull request #3504 from sharkdp/dependabot/cargo/proc-macro2-1.0.103
build(deps): bump proc-macro2 from 1.0.95 to 1.0.103
2025-12-02 22:04:00 +00:00
dependabot[bot] 9d4ca3bc22 build(deps): bump proc-macro2 from 1.0.95 to 1.0.103
Bumps [proc-macro2](https://github.com/dtolnay/proc-macro2) from 1.0.95 to 1.0.103.
- [Release notes](https://github.com/dtolnay/proc-macro2/releases)
- [Commits](https://github.com/dtolnay/proc-macro2/compare/1.0.95...1.0.103)

---
updated-dependencies:
- dependency-name: proc-macro2
  dependency-version: 1.0.103
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-02 21:48:06 +00:00
auto-merge-dependabot-prs[bot] 9b23b05841 Merge pull request #3502 from sharkdp/dependabot/cargo/console-0.16.1
build(deps): bump console from 0.16.0 to 0.16.1
2025-12-02 21:45:41 +00:00
dependabot[bot] f3e8ffc276 build(deps): bump console from 0.16.0 to 0.16.1
Bumps [console](https://github.com/console-rs/console) from 0.16.0 to 0.16.1.
- [Release notes](https://github.com/console-rs/console/releases)
- [Changelog](https://github.com/console-rs/console/blob/main/CHANGELOG.md)
- [Commits](https://github.com/console-rs/console/compare/0.16.0...0.16.1)

---
updated-dependencies:
- dependency-name: console
  dependency-version: 0.16.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-02 21:21:35 +00:00
auto-merge-dependabot-prs[bot] 9b73911f2c Merge pull request #3501 from sharkdp/dependabot/cargo/grep-cli-0.1.12
build(deps): bump grep-cli from 0.1.11 to 0.1.12
2025-12-02 21:19:00 +00:00
dependabot[bot] 25bfa9fa81 build(deps): bump grep-cli from 0.1.11 to 0.1.12
Bumps [grep-cli](https://github.com/BurntSushi/ripgrep) from 0.1.11 to 0.1.12.
- [Release notes](https://github.com/BurntSushi/ripgrep/releases)
- [Changelog](https://github.com/BurntSushi/ripgrep/blob/master/CHANGELOG.md)
- [Commits](https://github.com/BurntSushi/ripgrep/compare/grep-cli-0.1.11...grep-cli-0.1.12)

---
updated-dependencies:
- dependency-name: grep-cli
  dependency-version: 0.1.12
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-02 20:47:04 +00:00
Keith Hall 979ba22628 Merge pull request #3510 from sharkdp/prepare_release
Prepare for next release
2025-12-02 22:44:14 +02:00
Keith Hall 19ab724a73 Prepare for next release 2025-12-02 22:33:02 +02:00
Keith Hall def49e19a7 Merge pull request #3509 from sharkdp/ksh
Add syntax detection for files with ksh shebang lines
2025-12-02 22:15:48 +02:00
Keith Hall 1fb269a0fb Add syntax detection for files with ksh shebang lines 2025-12-02 22:06:21 +02:00
Keith Hall 0e469634a3 return None for get_pager_executable when builtin pager is used (#3498) 2025-12-01 20:02:55 +00:00
Keith Hall 6dfe471686 Merge pull request #3507 from sharkdp/help_read_theme_from_config
Ensure --help respects valid config file
2025-12-01 21:36:58 +02:00
Keith Hall 2c7fc5f926 update changelog 2025-12-01 06:51:04 +02:00
Keith Hall 579d371378 Ensure --help respects valid config file
While still ignoring ignoring invalid arguments in the config
2025-12-01 05:30:05 +02:00
auto-merge-dependabot-prs[bot] c74ca27075 Merge pull request #3500 from sharkdp/dependabot/submodules/assets/syntaxes/02_Extra/Idris2-bbfe50e
build(deps): bump assets/syntaxes/02_Extra/Idris2 from `2874f20` to `bbfe50e`
2025-12-01 03:21:57 +00:00
dependabot[bot] e8f7b12bb1 build(deps): bump assets/syntaxes/02_Extra/Idris2
Bumps [assets/syntaxes/02_Extra/Idris2](https://github.com/buzden/sublime-syntax-idris2) from `2874f20` to `bbfe50e`.
- [Commits](https://github.com/buzden/sublime-syntax-idris2/compare/2874f206f56c588a29fd76b88043129471d1454a...bbfe50e023e0edc74f5e0c003eb946528d49279f)

---
updated-dependencies:
- dependency-name: assets/syntaxes/02_Extra/Idris2
  dependency-version: bbfe50e023e0edc74f5e0c003eb946528d49279f
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-01 03:06:08 +00:00
Keith Hall e7006b53e3 Merge pull request #3497 from xduugu/quadlet
Add syntax mapping for podman's `artifact` quadlet files
2025-11-30 14:26:53 +02:00
Cedric Staniewski a6e0057c12 Add syntax mapping for podman's artifact quadlet files 2025-11-30 14:18:12 +02:00
Keith Hall 1ffed0c039 Merge pull request #3496 from sharkdp/decorations_auto
Restore expected behavior when piping output with styles configured and auto decorations
2025-11-30 05:14:01 +02:00
Keith Hall 602df893de Add additional test cases for -n in loop through mode 2025-11-30 05:02:13 +02:00
Keith Hall 3755f788ca Improve -n detection to handle combined flags correctly
Updated the logic to correctly handle combined short flags like -pn and -np.
The -n flag is only honored when it's either:
1. A standalone flag (-n or --number)
2. The last flag in a combined form that includes -p (e.g., -pn), or
3. In a combined form without -p (e.g., -An)

This ensures that -np (where -p overrides -n) correctly produces plain output,
while -pn (where -n overrides -p) produces line numbers.
2025-11-30 05:02:13 +02:00
Keith Hall abc7261488 Fix -n flag to show line numbers in loop-through mode
When the -n/--number flag is passed on the command line, bat now shows
line numbers even when piping output to another process (loop-through
mode), similar to how `cat -n` behaves.

This change detects if -n or --number was passed on the CLI (before
merging with config file and environment variables) and disables
loop-through mode in that case, allowing the InteractivePrinter to
add line numbers.

The existing behavior is preserved:
- Styles from config/env are still ignored when piping (unless --decorations=always is set)
- Only the -n flag from CLI enables line numbers in piped mode
- -p and --style options from CLI do not disable loop-through mode
2025-11-30 05:02:13 +02:00
Keith Hall f9c33971d9 Update readme to mention decorations 2025-11-30 05:02:13 +02:00
Keith Hall 7d37325c19 Fix to not show style decorations in auto mode when piping 2025-11-30 05:02:13 +02:00
Keith Hall d17481575a Merge pull request #3495 from sharkdp/powershell_completions
Update PowerShell completions for compatibility with PowerShell v5.1
2025-11-28 22:49:44 +02:00
Keith Hall 1ee1d8fdff update changelog 2025-11-27 21:57:47 +02:00
Keith Hall af8f0626ac Update PowerShell completions for compatibility with PowerShell v5.1
Modified the PowerShell completion script to replace the null-coalescing operator (`??` - a v7 feature) with a conditional statement compatible with PowerShell v5.1. The script now uses an if-else check for null descriptions in the language completion section.
2025-11-27 21:50:17 +02:00
Keith Hall c88353b386 Merge pull request #3476 from sharkdp/docker_syntax_fix
Revert "Bump assets/syntaxes/02_Extra/Docker from `0f6b7bc` to `c001fb2` (#3024)"
2025-11-26 22:19:06 +02:00
Keith Hall 961f367ca8 use newer MacOS runner images
otherwise CI fails due to the brownout https://github.com/actions/runner-images/issues/13046
2025-11-26 22:07:06 +02:00
Keith Hall 8bf3be5e61 Revert "Patch Dockerfile to replace reference to non-existent context"
This reverts commit a4212e99b0.

No longer needed because we reverted the Docker submodule.
2025-11-25 22:43:58 +02:00
Keith Hall f8b6a009cb commit syntax dump to get integration tests to pass 2025-11-24 22:30:34 +02:00
Keith Hall efa9f0e63d add integration test to prove that building the cache finds all contexts 2025-11-24 22:20:44 +02:00
Keith Hall a4212e99b0 Patch Dockerfile to replace reference to non-existent context 2025-11-24 22:05:31 +02:00
Keith Hall 6884a8e7e0 Update changelog 2025-11-24 21:56:05 +02:00
Keith Hall a1b1feb247 Revert "Bump assets/syntaxes/02_Extra/Docker from 0f6b7bc to c001fb2 (#3024)"
This reverts commit 3838766dd4.
2025-11-24 21:56:05 +02:00
Muntasir Mahmud 70ec3fc24e feat: add paging to '-h' and '--help' (#3478)
* feat: add paging to '-h' and '--help'

Fixes #1587
2025-11-23 20:10:56 +00:00
Keith Hall 1e4a4b765f Merge pull request #3457 from abhinavcool42/fix/list-themes-pager-hang
fix: `--list-themes` pagination
2025-11-15 15:49:40 +02:00
Keith Hall cfe49779fa Merge branch 'master' into fix/list-themes-pager-hang 2025-11-15 15:41:07 +02:00
Keith Hall c51cff8961 Merge pull request #3481 from AldanTanneo/master
update Ada syntax gitmodule
2025-11-14 19:46:22 +02:00
AldanTanneo 1abecd2c93 update Ada syntax gitmodule 2025-11-14 11:41:08 +01:00
Keith Hall 3217a7e667 Merge pull request #3484 from cyqsimon/quadlet-update
Update quadlet syntax mapping to include `*.{build,pod}` files
2025-11-13 19:15:28 +02:00
cyqsimon 015cafdbdc Write changelog 2025-11-13 13:50:53 +08:00
cyqsimon f5a934c213 Update quadlet syntax mapping to include *.{build,pod} files 2025-11-13 13:44:24 +08:00
Abhinav Diwakar 24813db49f Merge branch 'master' into fix/list-themes-pager-hang 2025-11-06 23:26:06 +05:30
Benjamin A. Beasley ce856dbba7 Update etcetera to 0.11; no longer depend on home; MSRV 1.87
Release 0.11 of `etcetera` requires MSRV 1.87, in which
`std::env::home_dir` is no longer deprecated,
https://github.com/rust-lang/rust/pull/137327.

Update to that MSRV and to `etcetera`, and drop the dependency on the
`home` crate just as `etcetera` 0.11 did.
2025-11-03 19:06:33 +01:00
abhinavcool42 8b09724420 change imports 2025-11-02 11:55:30 +05:30
abhinavcool42 2af7be1b65 fix prefix 2025-11-02 11:51:00 +05:30
Abhinav Diwakar dac98da526 Merge branch 'master' into fix/list-themes-pager-hang 2025-11-02 11:35:27 +05:30
abhinavcool42 9456f7d8cd list-themes buffer added 2025-11-02 11:31:07 +05:30
auto-merge-dependabot-prs[bot] 3ecbd18e56 Merge pull request #3469 from sharkdp/dependabot/submodules/assets/syntaxes/02_Extra/typst-syntax-highlight-363f0e7
build(deps): bump assets/syntaxes/02_Extra/typst-syntax-highlight from `4e2e68b` to `363f0e7`
2025-11-01 10:41:09 +00:00
dependabot[bot] 61fbc3fc0c build(deps): bump assets/syntaxes/02_Extra/typst-syntax-highlight
Bumps [assets/syntaxes/02_Extra/typst-syntax-highlight](https://github.com/hyrious/typst-syntax-highlight) from `4e2e68b` to `363f0e7`.
- [Release notes](https://github.com/hyrious/typst-syntax-highlight/releases)
- [Commits](https://github.com/hyrious/typst-syntax-highlight/compare/4e2e68b0a13555720a5ff0c4b32db98ddf490ed1...363f0e767c938c615a14912c302db7936f025fc2)

---
updated-dependencies:
- dependency-name: assets/syntaxes/02_Extra/typst-syntax-highlight
  dependency-version: 363f0e767c938c615a14912c302db7936f025fc2
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-01 10:24:37 +00:00
auto-merge-dependabot-prs[bot] 5bcbd91943 Merge pull request #3472 from sharkdp/dependabot/submodules/assets/syntaxes/02_Extra/Zig-c16d871
build(deps): bump assets/syntaxes/02_Extra/Zig from `8a4a3fe` to `c16d871`
2025-11-01 10:21:28 +00:00
dependabot[bot] cfe32fa219 build(deps): bump assets/syntaxes/02_Extra/Zig
Bumps [assets/syntaxes/02_Extra/Zig](https://github.com/ziglang/sublime-zig-language) from `8a4a3fe` to `c16d871`.
- [Release notes](https://github.com/ziglang/sublime-zig-language/releases)
- [Commits](https://github.com/ziglang/sublime-zig-language/compare/8a4a3fe4a051f85c4752b82f586d395cab843c06...c16d871ccccb3749f5a4b824f3fd44b143114565)

---
updated-dependencies:
- dependency-name: assets/syntaxes/02_Extra/Zig
  dependency-version: c16d871ccccb3749f5a4b824f3fd44b143114565
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-01 10:05:25 +00:00
auto-merge-dependabot-prs[bot] f0f4af864a Merge pull request #3470 from sharkdp/dependabot/submodules/assets/syntaxes/02_Extra/cmd-help-273cb98
build(deps): bump assets/syntaxes/02_Extra/cmd-help from `c71ba41` to `273cb98`
2025-11-01 10:01:27 +00:00
dependabot[bot] 8bace0e808 build(deps): bump assets/syntaxes/02_Extra/cmd-help
Bumps [assets/syntaxes/02_Extra/cmd-help](https://github.com/victor-gp/cmd-help-sublime-syntax) from `c71ba41` to `273cb98`.
- [Commits](https://github.com/victor-gp/cmd-help-sublime-syntax/compare/c71ba410bdfcc8f627df3219f14e3f2be4fe68ba...273cb988177e96f4187e06008b13fa72ad22ae4d)

---
updated-dependencies:
- dependency-name: assets/syntaxes/02_Extra/cmd-help
  dependency-version: 273cb988177e96f4187e06008b13fa72ad22ae4d
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-01 09:40:14 +00:00
auto-merge-dependabot-prs[bot] 2f5cba7f8f Merge pull request #3473 from sharkdp/dependabot/submodules/assets/syntaxes/02_Extra/SystemVerilog-b340f1c
build(deps): bump assets/syntaxes/02_Extra/SystemVerilog from `7eca705` to `b340f1c`
2025-11-01 09:37:25 +00:00
dependabot[bot] 528aa4fedd build(deps): bump assets/syntaxes/02_Extra/SystemVerilog
Bumps [assets/syntaxes/02_Extra/SystemVerilog](https://github.com/TheClams/SystemVerilog) from `7eca705` to `b340f1c`.
- [Commits](https://github.com/TheClams/SystemVerilog/compare/7eca705e87f87b94478fe222fc91d54d488cc8e3...b340f1c7f6a38d4da9f77be5abd6d455e5da7641)

---
updated-dependencies:
- dependency-name: assets/syntaxes/02_Extra/SystemVerilog
  dependency-version: b340f1c7f6a38d4da9f77be5abd6d455e5da7641
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-01 09:27:44 +00:00
auto-merge-dependabot-prs[bot] 490e1580ad Merge pull request #3471 from sharkdp/dependabot/cargo/serde_with-3.15.1
build(deps): bump serde_with from 3.12.0 to 3.15.1
2025-11-01 05:15:10 +00:00
dependabot[bot] cbfbfc8ff3 build(deps): bump serde_with from 3.12.0 to 3.15.1
Bumps [serde_with](https://github.com/jonasbb/serde_with) from 3.12.0 to 3.15.1.
- [Release notes](https://github.com/jonasbb/serde_with/releases)
- [Commits](https://github.com/jonasbb/serde_with/compare/v3.12.0...v3.15.1)

---
updated-dependencies:
- dependency-name: serde_with
  dependency-version: 3.15.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-01 05:03:16 +00:00
auto-merge-dependabot-prs[bot] b6edf7ab0b Merge pull request #3468 from sharkdp/dependabot/cargo/prettyplease-0.2.37
build(deps): bump prettyplease from 0.2.35 to 0.2.37
2025-11-01 05:00:21 +00:00
dependabot[bot] 65e6b4de69 build(deps): bump prettyplease from 0.2.35 to 0.2.37
Bumps [prettyplease](https://github.com/dtolnay/prettyplease) from 0.2.35 to 0.2.37.
- [Release notes](https://github.com/dtolnay/prettyplease/releases)
- [Commits](https://github.com/dtolnay/prettyplease/compare/0.2.35...0.2.37)

---
updated-dependencies:
- dependency-name: prettyplease
  dependency-version: 0.2.37
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-01 04:42:58 +00:00
auto-merge-dependabot-prs[bot] 2ca62e25f1 Merge pull request #3474 from sharkdp/dependabot/cargo/git2-0.20.2
build(deps): bump git2 from 0.20.0 to 0.20.2
2025-11-01 04:39:53 +00:00
dependabot[bot] 1b2a814478 build(deps): bump git2 from 0.20.0 to 0.20.2
Bumps [git2](https://github.com/rust-lang/git2-rs) from 0.20.0 to 0.20.2.
- [Changelog](https://github.com/rust-lang/git2-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/git2-rs/compare/git2-0.20.0...git2-0.20.2)

---
updated-dependencies:
- dependency-name: git2
  dependency-version: 0.20.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-01 04:22:33 +00:00
auto-merge-dependabot-prs[bot] e33967aa39 Merge pull request #3467 from sharkdp/dependabot/cargo/regex-1.12.2
build(deps): bump regex from 1.11.1 to 1.12.2
2025-11-01 04:17:04 +00:00
dependabot[bot] a1adefce36 build(deps): bump regex from 1.11.1 to 1.12.2
Bumps [regex](https://github.com/rust-lang/regex) from 1.11.1 to 1.12.2.
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/1.11.1...1.12.2)

---
updated-dependencies:
- dependency-name: regex
  dependency-version: 1.12.2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-01 03:40:47 +00:00
auto-merge-dependabot-prs[bot] 6e87e02e96 Merge pull request #3465 from sharkdp/dependabot/cargo/terminal-colorsaurus-1.0.1
build(deps): bump terminal-colorsaurus from 1.0.0 to 1.0.1
2025-11-01 03:37:12 +00:00
dependabot[bot] ab9cc674d5 build(deps): bump terminal-colorsaurus from 1.0.0 to 1.0.1
Bumps [terminal-colorsaurus](https://github.com/bash/terminal-colorsaurus) from 1.0.0 to 1.0.1.
- [Release notes](https://github.com/bash/terminal-colorsaurus/releases)
- [Changelog](https://github.com/bash/terminal-colorsaurus/blob/main/changelog.md)
- [Commits](https://github.com/bash/terminal-colorsaurus/compare/1.0.0...1.0.1)

---
updated-dependencies:
- dependency-name: terminal-colorsaurus
  dependency-version: 1.0.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-01 03:02:09 +00:00
Abhinav Diwakar 8e0e13a899 Merge branch 'master' into fix/list-themes-pager-hang 2025-11-01 00:59:59 +05:30
Jack Haden-Enneking 5371426588 alternatives.md: fix emoji & formatting
Could replace all emoji shortcodes (`✔️` & ``) in source with actual emoji. Erred on the side of least change.
2025-10-31 19:32:29 +01:00
abhinavcool42 1852dea96a Fix --list-themes pager init so less stays interactive 2025-10-30 18:42:35 +05:30
abhinavcool42 a8140f91cc changelog 2025-10-28 17:25:43 +05:30
abhinavcool42 2fac9b2740 added changelog 2025-10-28 17:07:12 +05:30
abhinavcool42 6a99915afe fix --list-themes hang 2025-10-28 16:10:32 +05:30
Justin Su 4e13c3eb5b Update CHANGELOG.md
Also fix a typo from the previous release
2025-10-20 19:23:26 +02:00
Justin Su 7e55608975 docs: Clarify that -X/--no-init is not added on modern versions of less 2025-10-20 19:23:26 +02:00
Justin Su 4bd5cbca8e docs: Mention less options by short+long names 2025-10-20 19:23:26 +02:00
Keith Hall 7c3fa7e1ce Merge pull request #3448 from akinomyoga/bash-fullquote
Use `-o fullquote` and `-o noquote` for more robust escaping in Bash completions
2025-10-20 19:55:56 +03:00
Koichi Murase 3188a147d8 Use "-o fullquote" and "-o noquote" to escape Bash completions 2025-10-20 19:38:54 +09:00
Koichi Murase 926fbc4b13 Fix indentation of the Bash completion file 2025-10-20 17:59:48 +09:00
Keith Hall 006d77fa39 Merge pull request #3442 from lmmx/patch-1
fix: allow hyphen values to `-r`/`--line-range`
2025-10-19 23:44:25 +03:00
Louis Maddox 52a792d46f fix: allow hyphen values to -r/--line-range
via #2944
2025-10-19 21:24:59 +01:00
Keith Hall 20db989fb1 Merge pull request #3441 from sharkdp/prepare_changelog
Prepare changelog for future changes
2025-10-19 21:40:50 +03:00
Keith Hall 2c63d3c792 Prepare changelog for future changes 2025-10-19 21:24:54 +03:00
48 changed files with 1089 additions and 427 deletions
+22 -22
View File
@@ -35,7 +35,7 @@ jobs:
name: Extract crate metadata
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
- name: Extract crate information
id: crate_metadata
run: |
@@ -58,7 +58,7 @@ jobs:
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt,clippy
- uses: actions/checkout@v5
- uses: actions/checkout@v6
- run: cargo fmt -- --check
- run: cargo clippy --locked --all-targets --all-features -- -D warnings
@@ -68,7 +68,7 @@ jobs:
needs: crate_metadata
steps:
- name: Checkout source code
uses: actions/checkout@v5
uses: actions/checkout@v6
- name: Install rust toolchain (v${{ needs.crate_metadata.outputs.msrv }})
uses: dtolnay/rust-toolchain@master
with:
@@ -80,7 +80,7 @@ jobs:
name: License checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
with:
submodules: true # we especially want to perform license checks on submodules
- run: tests/scripts/license-checks.sh
@@ -90,7 +90,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Git checkout
uses: actions/checkout@v5
uses: actions/checkout@v6
with:
submodules: true # we need all syntax and theme submodules
- name: Install Rust toolchain
@@ -119,7 +119,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Git checkout
uses: actions/checkout@v5
uses: actions/checkout@v6
- name: Prepare environment variables
run: |
echo "BAT_SYSTEM_CONFIG_PREFIX=$GITHUB_WORKSPACE/tests/examples/system_config" >> $GITHUB_ENV
@@ -135,7 +135,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Git checkout
uses: actions/checkout@v5
uses: actions/checkout@v6
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Check documentation
@@ -150,7 +150,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- run: cargo install cargo-audit --locked
- uses: actions/checkout@v5
- uses: actions/checkout@v6
- run: cargo audit
build:
@@ -161,24 +161,24 @@ jobs:
fail-fast: false
matrix:
job:
- { target: aarch64-unknown-linux-musl , os: ubuntu-latest, dpkg_arch: arm64, use-cross: true }
- { target: aarch64-unknown-linux-gnu , os: ubuntu-latest, dpkg_arch: arm64, use-cross: true }
- { target: arm-unknown-linux-gnueabihf , os: ubuntu-latest, dpkg_arch: armhf, use-cross: true }
- { target: arm-unknown-linux-musleabihf, os: ubuntu-latest, dpkg_arch: musl-linux-armhf, use-cross: true }
- { target: i686-pc-windows-msvc , os: windows-2025, }
- { target: i686-unknown-linux-gnu , os: ubuntu-latest, dpkg_arch: i686, use-cross: true }
- { target: i686-unknown-linux-musl , os: ubuntu-latest, dpkg_arch: musl-linux-i686, use-cross: true }
- { target: x86_64-apple-darwin , os: macos-13, }
- { target: aarch64-apple-darwin , os: macos-14, }
- { target: x86_64-pc-windows-msvc , os: windows-2025, }
- { target: aarch64-pc-windows-msvc , os: windows-11-arm, }
- { target: x86_64-unknown-linux-gnu , os: ubuntu-latest, dpkg_arch: amd64, use-cross: true }
- { target: x86_64-unknown-linux-musl , os: ubuntu-latest, dpkg_arch: musl-linux-amd64, use-cross: true }
- { target: aarch64-unknown-linux-musl , os: ubuntu-latest , dpkg_arch: arm64, use-cross: true }
- { target: aarch64-unknown-linux-gnu , os: ubuntu-latest , dpkg_arch: arm64, use-cross: true }
- { target: arm-unknown-linux-gnueabihf , os: ubuntu-latest , dpkg_arch: armhf, use-cross: true }
- { target: arm-unknown-linux-musleabihf, os: ubuntu-latest , dpkg_arch: musl-linux-armhf, use-cross: true }
- { target: i686-pc-windows-msvc , os: windows-2025 , }
- { target: i686-unknown-linux-gnu , os: ubuntu-latest , dpkg_arch: i686, use-cross: true }
- { target: i686-unknown-linux-musl , os: ubuntu-latest , dpkg_arch: musl-linux-i686, use-cross: true }
- { target: x86_64-apple-darwin , os: macos-15-intel, }
- { target: aarch64-apple-darwin , os: macos-latest , }
- { target: x86_64-pc-windows-msvc , os: windows-2025 , }
- { target: aarch64-pc-windows-msvc , os: windows-11-arm, }
- { target: x86_64-unknown-linux-gnu , os: ubuntu-latest , dpkg_arch: amd64, use-cross: true }
- { target: x86_64-unknown-linux-musl , os: ubuntu-latest , dpkg_arch: musl-linux-amd64, use-cross: true }
env:
BUILD_CMD: cargo
steps:
- name: Checkout source code
uses: actions/checkout@v5
uses: actions/checkout@v6
- name: Install prerequisites
shell: bash
@@ -13,7 +13,7 @@ jobs:
PR_NUMBER: ${{ github.event.number }}
PR_BASE: ${{ github.base_ref }}
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
- name: Fetch PR base
run: git fetch --no-tags --prune --depth=1 origin
+4
View File
@@ -1,6 +1,10 @@
/target/
**/*.rs.bk
# Editors
.idea/
.vscode/
# Generated files
/assets/completions/_bat.ps1
/assets/completions/bat.bash
+3 -6
View File
@@ -130,7 +130,7 @@
url = https://github.com/djuretic/SublimeStrace
[submodule "assets/syntaxes/Jinja2"]
path = assets/syntaxes/02_Extra/Jinja2
url = https://github.com/Martin819/sublime-jinja2
url = https://github.com/ltrzesniewski/sublime-jinja2.git
[submodule "assets/syntaxes/SLS"]
path = assets/syntaxes/02_Extra/SLS
url = https://github.com/saltstack/sublime-text
@@ -196,16 +196,13 @@
url = https://github.com/leanprover/vscode-lean4.git
[submodule "assets/syntaxes/02_Extra/Zig"]
path = assets/syntaxes/02_Extra/Zig
url = https://github.com/ziglang/sublime-zig-language.git
url = https://codeberg.org/ziglang/sublime-zig-language.git
[submodule "assets/syntaxes/02_Extra/gnuplot"]
path = assets/syntaxes/02_Extra/gnuplot
url = https://github.com/hesstobi/sublime_gnuplot
[submodule "assets/syntaxes/02_Extra/SystemVerilog"]
path = assets/syntaxes/02_Extra/SystemVerilog
url = https://github.com/TheClams/SystemVerilog.git
[submodule "assets/themes/visual-studio-dark-plus"]
path = assets/themes/visual-studio-dark-plus
url = https://github.com/vidann1/visual-studio-dark-plus.git
[submodule "assets/syntaxes/02_Extra/SublimeEthereum"]
path = assets/syntaxes/02_Extra/SublimeEthereum
url = https://github.com/davidhq/SublimeEthereum.git
@@ -243,7 +240,7 @@
url = https://github.com/dertuxmalwieder/SublimeTodoTxt
[submodule "assets/syntaxes/02_Extra/Ada"]
path = assets/syntaxes/02_Extra/Ada
url = https://github.com/wiremoons/ada-sublime-syntax
url = https://github.com/AldanTanneo/ada-sublime-syntax
[submodule "assets/syntaxes/02_Extra/Crontab"]
path = assets/syntaxes/02_Extra/Crontab
+58 -1
View File
@@ -1,3 +1,60 @@
# unreleased
- Fixed bug caused by using `--plain` and `--terminal-width=N` flags simultaneously, see #3529 (@H4k1l)
## Features
- Improve native man pages and command help syntax highlighting by stripping overstriking, see #3517 (@akirk)
## Bugfixes
- `--help` now correctly honors `--pager=builtin`. See #3516 (@keith-hall)
- `--help` now correctly honors custom themes. See #3524 (@keith-hall)
- Fixed test compatibility with future Cargo build directory changes, see #3550 (@nmacl)
## Other
## Syntaxes
- Change the URL of Zig submodule from GitHub to Codeberg, see #3519 (@sorairolake)
- Don't color strings inside CSV files, to make it easier to tell which column they belong to, see #3521 (@keith-hall)
## Themes
- Remove the Visual Studio Dark+ theme, see #3552 (@CosmicHorrorDev)
## `bat` as a library
# v0.26.1
## Features
- Add paging to '-h' and '--help' see PR #3478 (@MuntasirSZN)
## Bugfixes
- Fix hang when using `--list-themes` with an explicit pager, see #3457 (@abhinavcool42)
- Fix negative values of N not being parsed in <N:M> line ranges without `=` flag value separator, see #3442 (@lmmx)
- Fix broken Docker syntax preventing use of custom assets, see #3476 (@keith-hall)
- Fix decorations being applied unexpectedly when piping. Now only line numbers explicitly required on the command line should be applied in auto decorations mode for `cat` compatibility. See #3496 (@keith-hall)
- Fix diagnostics attempting to find the version of an executable named builtin when builtin pager is used. See #3498 (@keith-hall)
- `--help` now correctly reads the config file for theme information etc. See #3507 (@keith-hall)
## Other
- Improve README documentation on pager options passed to less, see #3443 (@injust)
- Make PowerShell completions compatible with PowerShell v5.1, see #3495 (@keith-hall)
- Use more robust approach to escaping in Bash completions, see #3448 (@akinomyoga)
## Syntaxes
- Update quadlet syntax mapping to include *.{build,pod} files #3484 (@cyqsimon)
- Fix inconsistencies in Ada syntax, see #3481 (@AldanTanneo)
- Add syntax mapping for podman's `artifact` quadlet files, see #3497 (@xduugu)
- Highlight Korn Shell scripts (i.e. with a shebang of ...`ksh`) using Bash syntax, see #3509 (@keith-hall)
## Themes
## `bat` as a library
# v0.26.0
## Features
@@ -29,7 +86,7 @@
- Update base16 README links to community driven base16 work #2871 (@JamyGolden)
- Work around build failures when building `bat` from vendored sources #3179 (@dtolnay)
- CICD: Stop building for x86_64-pc-windows-gnu which fails #3261 (Enselic)
- CICD: CICD: replace windows-2019 runners with windows-2025 #3339 (@cyqsimon)
- CICD: replace windows-2019 runners with windows-2025 #3339 (@cyqsimon)
- Build script: replace string-based codegen with quote-based codegen #3340 (@cyqsimon)
- Improve code coverage of `--list-languages` parameter #2942 (@sblondon)
- Only start offload worker thread when there's more than 1 core #2956 (@cyqsimon)
Generated
+126 -183
View File
@@ -1,6 +1,6 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3
version = 4
[[package]]
name = "adler2"
@@ -83,13 +83,12 @@ checksum = "dcfed56ad506cb2c684a14971b8861fdc3baaaae314b9e5f9bb532cbe3ba7a4f"
[[package]]
name = "assert_cmd"
version = "2.0.16"
version = "2.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dc1835b7f27878de8525dc71410b5a31cdcc5f230aed5ba5df968e09c201b23d"
checksum = "bcbb6924530aa9e0432442af08bbcafdad182db80d2e560da42a6d442535bf85"
dependencies = [
"anstyle",
"bstr",
"doc-comment",
"libc",
"predicates",
"predicates-core",
@@ -111,7 +110,7 @@ checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6"
[[package]]
name = "bat"
version = "0.26.0"
version = "0.26.1"
dependencies = [
"ansi_colours",
"anyhow",
@@ -131,7 +130,6 @@ dependencies = [
"git2",
"globset",
"grep-cli",
"home",
"indexmap",
"itertools",
"minus",
@@ -298,15 +296,15 @@ checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990"
[[package]]
name = "console"
version = "0.16.0"
version = "0.16.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2e09ced7ebbccb63b4c65413d821f2e00ce54c5ca4514ddc6b3c892fdbcbc69d"
checksum = "03e45a4a8926227e4197636ba97a9fc9b00477e9f4bd711395687c5f0734bec4"
dependencies = [
"encode_unicode",
"libc",
"once_cell",
"unicode-width",
"windows-sys 0.60.2",
"windows-sys 0.61.2",
]
[[package]]
@@ -394,9 +392,9 @@ dependencies = [
[[package]]
name = "darling"
version = "0.20.10"
version = "0.21.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989"
checksum = "9cdf337090841a411e2a7f3deb9187445851f91b309c0c0a29e05f74a00a48c0"
dependencies = [
"darling_core",
"darling_macro",
@@ -404,9 +402,9 @@ dependencies = [
[[package]]
name = "darling_core"
version = "0.20.10"
version = "0.21.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5"
checksum = "1247195ecd7e3c85f83c8d2a366e4210d588e802133e1e355180a9870b517ea4"
dependencies = [
"fnv",
"ident_case",
@@ -418,9 +416,9 @@ dependencies = [
[[package]]
name = "darling_macro"
version = "0.20.10"
version = "0.21.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806"
checksum = "d38308df82d1080de0afee5d069fa14b0326a88c14f15c5ccda35b4a6c414c81"
dependencies = [
"darling_core",
"quote",
@@ -472,12 +470,6 @@ version = "1.0.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "59f8e79d1fbf76bdfbde321e902714bf6c49df88a7dda6fc682fc2979226962d"
[[package]]
name = "doc-comment"
version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10"
[[package]]
name = "either"
version = "1.13.0"
@@ -517,20 +509,19 @@ dependencies = [
[[package]]
name = "etcetera"
version = "0.10.0"
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "26c7b13d0780cb82722fd59f6f57f925e143427e4a75313a6c77243bf5326ae6"
checksum = "de48cc4d1c1d97a20fd819def54b890cadde72ed3ad0c614822a0a433361be96"
dependencies = [
"cfg-if",
"home",
"windows-sys 0.59.0",
"windows-sys 0.61.2",
]
[[package]]
name = "execute"
version = "0.2.13"
version = "0.2.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3a82608ee96ce76aeab659e9b8d3c2b787bffd223199af88c674923d861ada10"
checksum = "0be3cc61fe54b4cae4463cdbda0401978ffe19d4dcc7a5201a312cddf64726dd"
dependencies = [
"execute-command-macro",
"execute-command-tokens",
@@ -667,9 +658,9 @@ dependencies = [
[[package]]
name = "git2"
version = "0.20.0"
version = "0.20.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3fda788993cc341f69012feba8bf45c0ba4f3291fcc08e214b4d5a7332d88aff"
checksum = "2deb07a133b1520dc1a5690e9bd08950108873d7ed5de38dcc74d3b5ebffa110"
dependencies = [
"bitflags",
"libc",
@@ -686,9 +677,9 @@ checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2"
[[package]]
name = "globset"
version = "0.4.16"
version = "0.4.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "54a1028dfc5f5df5da8a56a73e6c153c9a9708ec57232470703592a3f18e49f5"
checksum = "52dfc19153a48bde0cbd630453615c8151bce3a5adfac7a0aebfbf0a1e1f57e3"
dependencies = [
"aho-corasick",
"bstr",
@@ -699,9 +690,9 @@ dependencies = [
[[package]]
name = "grep-cli"
version = "0.1.11"
version = "0.1.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "47f1288f0e06f279f84926fa4c17e3fcd2a22b357927a82f2777f7be26e4cec0"
checksum = "cf32d263c5d5cc2a23ce587097f5ddafdb188492ba2e6fb638eaccdc22453631"
dependencies = [
"bstr",
"globset",
@@ -719,18 +710,9 @@ checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1"
[[package]]
name = "hashbrown"
version = "0.15.2"
version = "0.16.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289"
[[package]]
name = "home"
version = "0.5.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5"
dependencies = [
"windows-sys 0.52.0",
]
checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100"
[[package]]
name = "icu_collections"
@@ -879,13 +861,14 @@ dependencies = [
[[package]]
name = "indexmap"
version = "2.8.0"
version = "2.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3954d50fe15b02142bf25d3b8bdadb634ec3948f103d04ffe3031bc8fe9d7058"
checksum = "0ad4bb2b565bca0645f4d68c5c9af97fba094e9791da685bf83cb5f3ce74acf2"
dependencies = [
"equivalent",
"hashbrown 0.15.2",
"hashbrown 0.16.1",
"serde",
"serde_core",
]
[[package]]
@@ -932,9 +915,9 @@ checksum = "6a82ae493e598baaea5209805c49bbf2ea7de956d50d7da0da1164f9c6d28543"
[[package]]
name = "libgit2-sys"
version = "0.18.0+1.9.0"
version = "0.18.2+1.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e1a117465e7e1597e8febea8bb0c410f1c7fb93b1e1cddf34363f8390367ffec"
checksum = "1c42fe03df2bd3c53a3a9c7317ad91d80c81cd1fb0caec8d7cc4cd2bfa10c222"
dependencies = [
"cc",
"libc",
@@ -966,6 +949,12 @@ version = "0.4.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab"
[[package]]
name = "linux-raw-sys"
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "df1d3c3b53da64cf5760482273a98e575c651a67eec7f77df96b5b642de8f039"
[[package]]
name = "litemap"
version = "0.7.4"
@@ -1032,13 +1021,13 @@ dependencies = [
[[package]]
name = "mio"
version = "1.0.3"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd"
checksum = "69d83b0086dc8ecf3ce9ae2874b2d1290252e2a30720bea58a5c6639b0092873"
dependencies = [
"libc",
"wasi 0.11.0+wasi-snapshot-preview1",
"windows-sys 0.52.0",
"windows-sys 0.61.2",
]
[[package]]
@@ -1070,11 +1059,11 @@ dependencies = [
[[package]]
name = "nu-ansi-term"
version = "0.50.1"
version = "0.50.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d4a28e057d01f97e61255210fcff094d74ed0466038633e95017f5beb68e4399"
checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5"
dependencies = [
"windows-sys 0.52.0",
"windows-sys 0.61.2",
]
[[package]]
@@ -1218,9 +1207,9 @@ dependencies = [
[[package]]
name = "prettyplease"
version = "0.2.35"
version = "0.2.37"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "061c1221631e079b26479d25bbf2275bfe5917ae8419cd7e34f13bfc2aa7539a"
checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b"
dependencies = [
"proc-macro2",
"syn",
@@ -1228,9 +1217,9 @@ dependencies = [
[[package]]
name = "proc-macro2"
version = "1.0.95"
version = "1.0.103"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778"
checksum = "5ee95bc4ef87b8d5ba32e8b7714ccc834865276eab0aed5c9958d00ec45f49e8"
dependencies = [
"unicode-ident",
]
@@ -1284,9 +1273,9 @@ dependencies = [
[[package]]
name = "regex"
version = "1.11.1"
version = "1.12.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191"
checksum = "843bc0191f75f3e22651ae5f1e72939ab2f72a4bc30fa80a066bd66edefc24d4"
dependencies = [
"aho-corasick",
"memchr",
@@ -1296,9 +1285,9 @@ dependencies = [
[[package]]
name = "regex-automata"
version = "0.4.9"
version = "0.4.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908"
checksum = "5276caf25ac86c8d810222b3dbb938e512c55c6831a10f3e6ed1c93b84041f1c"
dependencies = [
"aho-corasick",
"memchr",
@@ -1329,10 +1318,23 @@ dependencies = [
"bitflags",
"errno",
"libc",
"linux-raw-sys",
"linux-raw-sys 0.4.15",
"windows-sys 0.59.0",
]
[[package]]
name = "rustix"
version = "1.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cd15f8a2c5551a84d56efdc1cd049089e409ac19a3072d5037a17fd70719ff3e"
dependencies = [
"bitflags",
"errno",
"libc",
"linux-raw-sys 0.11.0",
"windows-sys 0.61.2",
]
[[package]]
name = "ryu"
version = "1.0.18"
@@ -1362,18 +1364,28 @@ checksum = "f79dfe2d285b0488816f30e700a7438c5a73d816b5b7d3ac72fbc48b0d185e03"
[[package]]
name = "serde"
version = "1.0.217"
version = "1.0.228"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70"
checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e"
dependencies = [
"serde_core",
"serde_derive",
]
[[package]]
name = "serde_core"
version = "1.0.228"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad"
dependencies = [
"serde_derive",
]
[[package]]
name = "serde_derive"
version = "1.0.217"
version = "1.0.228"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0"
checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79"
dependencies = [
"proc-macro2",
"quote",
@@ -1394,29 +1406,28 @@ dependencies = [
[[package]]
name = "serde_spanned"
version = "1.0.0"
version = "1.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "40734c41988f7306bb04f0ecf60ec0f3f1caa34290e4e8ea471dcd3346483b83"
checksum = "e24345aa0fe688594e73770a5f6d1b216508b4f93484c0026d521acd30134392"
dependencies = [
"serde",
"serde_core",
]
[[package]]
name = "serde_with"
version = "3.12.0"
version = "3.15.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d6b6f7f2fcb69f747921f79f3926bd1e203fce4fef62c268dd3abfb6d86029aa"
checksum = "aa66c845eee442168b2c8134fec70ac50dc20e760769c8ba0ad1319ca1959b04"
dependencies = [
"serde",
"serde_derive",
"serde_core",
"serde_with_macros",
]
[[package]]
name = "serde_with_macros"
version = "3.12.0"
version = "3.15.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8d00caa5193a3c8362ac2b73be6b9e768aa5a4b2f721d8f4b339600c3cb51f8e"
checksum = "b91a903660542fced4e99881aa481bdbaec1634568ee02e0b8bd57c64cb38955"
dependencies = [
"darling",
"proc-macro2",
@@ -1468,9 +1479,9 @@ checksum = "45bb67a18fa91266cc7807181f62f9178a6873bfad7dc788c42e6430db40184f"
[[package]]
name = "shell-words"
version = "1.1.0"
version = "1.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde"
checksum = "dc6fe69c597f9c37bfeeeeeb33da3530379845f10be461a66d16d03eca2ded77"
[[package]]
name = "shlex"
@@ -1534,9 +1545,9 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f"
[[package]]
name = "syn"
version = "2.0.104"
version = "2.0.108"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "17b6f705963418cdb9927482fa304bc562ece2fdd4f616084c50b7023b435a40"
checksum = "da58917d35242480a05c2897064da0a80589a2a0476c9a3f2fdc83b53502e917"
dependencies = [
"proc-macro2",
"quote",
@@ -1592,16 +1603,15 @@ dependencies = [
[[package]]
name = "tempfile"
version = "3.16.0"
version = "3.23.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "38c246215d7d24f48ae091a2902398798e05d978b24315d6efbc00ede9a8bb91"
checksum = "2d31c77bdf42a745371d260a26ca7163f1e0924b64afa0b688e61b5a9fa02f16"
dependencies = [
"cfg-if",
"fastrand",
"getrandom",
"once_cell",
"rustix",
"windows-sys 0.59.0",
"rustix 1.1.2",
"windows-sys 0.61.2",
]
[[package]]
@@ -1615,28 +1625,28 @@ dependencies = [
[[package]]
name = "terminal-colorsaurus"
version = "1.0.0"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3f7226dad4b1817567c1e2f5d453897ef36abe79def7783af3fa241a694e30b3"
checksum = "8909f33134da34b43f69145e748790de650a6abd84faf1f82e773444dd293ec8"
dependencies = [
"cfg-if",
"libc",
"memchr",
"mio 1.0.3",
"mio 1.1.0",
"terminal-trx",
"windows-sys 0.59.0",
"windows-sys 0.61.2",
"xterm-color",
]
[[package]]
name = "terminal-trx"
version = "0.2.4"
version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "975b4233aefa1b02456d5e53b22c61653c743e308c51cf4181191d8ce41753ab"
checksum = "662a3cd5ca570df622e848ef18b50c151e65c9835257465417242243b0bce783"
dependencies = [
"cfg-if",
"libc",
"windows-sys 0.59.0",
"windows-sys 0.61.2",
]
[[package]]
@@ -1645,7 +1655,7 @@ version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5352447f921fda68cf61b4101566c0bdb5104eff6804d0678e5227580ab6a4e9"
dependencies = [
"rustix",
"rustix 0.38.43",
"windows-sys 0.59.0",
]
@@ -1747,12 +1757,12 @@ dependencies = [
[[package]]
name = "toml"
version = "0.9.1"
version = "0.9.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0207d6ed1852c2a124c1fbec61621acb8330d2bf969a5d0643131e9affd985a5"
checksum = "f0dc8b1fb61449e27716ec0e1bdf0f6b8f3e8f6b05391e8497b8b6d7804ea6d8"
dependencies = [
"indexmap",
"serde",
"serde_core",
"serde_spanned",
"toml_datetime",
"toml_parser",
@@ -1762,27 +1772,27 @@ dependencies = [
[[package]]
name = "toml_datetime"
version = "0.7.0"
version = "0.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bade1c3e902f58d73d3f294cd7f20391c1cb2fbcb643b73566bc773971df91e3"
checksum = "f2cdb639ebbc97961c51720f858597f7f24c4fc295327923af55b74c3c724533"
dependencies = [
"serde",
"serde_core",
]
[[package]]
name = "toml_parser"
version = "1.0.0"
version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b5c1c469eda89749d2230d8156a5969a69ffe0d6d01200581cdc6110674d293e"
checksum = "c0cbe268d35bdb4bb5a56a2de88d0ad0eb70af5384a99d648cd4b3d04039800e"
dependencies = [
"winnow",
]
[[package]]
name = "toml_writer"
version = "1.0.0"
version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b679217f2848de74cabd3e8fc5e6d66f40b7da40f8e1954d92054d9010690fd5"
checksum = "df8b2b54733674ad286d16267dcfc7a71ed5c776e4ac7aa3c3e2561f7c637bf2"
[[package]]
name = "typenum"
@@ -2011,6 +2021,12 @@ dependencies = [
"syn",
]
[[package]]
name = "windows-link"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5"
[[package]]
name = "windows-result"
version = "0.1.2"
@@ -2029,15 +2045,6 @@ dependencies = [
"windows-targets 0.48.5",
]
[[package]]
name = "windows-sys"
version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d"
dependencies = [
"windows-targets 0.52.6",
]
[[package]]
name = "windows-sys"
version = "0.59.0"
@@ -2049,11 +2056,11 @@ dependencies = [
[[package]]
name = "windows-sys"
version = "0.60.2"
version = "0.61.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb"
checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc"
dependencies = [
"windows-targets 0.53.2",
"windows-link",
]
[[package]]
@@ -2080,29 +2087,13 @@ dependencies = [
"windows_aarch64_gnullvm 0.52.6",
"windows_aarch64_msvc 0.52.6",
"windows_i686_gnu 0.52.6",
"windows_i686_gnullvm 0.52.6",
"windows_i686_gnullvm",
"windows_i686_msvc 0.52.6",
"windows_x86_64_gnu 0.52.6",
"windows_x86_64_gnullvm 0.52.6",
"windows_x86_64_msvc 0.52.6",
]
[[package]]
name = "windows-targets"
version = "0.53.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c66f69fcc9ce11da9966ddb31a40968cad001c5bedeb5c2b82ede4253ab48aef"
dependencies = [
"windows_aarch64_gnullvm 0.53.0",
"windows_aarch64_msvc 0.53.0",
"windows_i686_gnu 0.53.0",
"windows_i686_gnullvm 0.53.0",
"windows_i686_msvc 0.53.0",
"windows_x86_64_gnu 0.53.0",
"windows_x86_64_gnullvm 0.53.0",
"windows_x86_64_msvc 0.53.0",
]
[[package]]
name = "windows_aarch64_gnullvm"
version = "0.48.5"
@@ -2115,12 +2106,6 @@ version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3"
[[package]]
name = "windows_aarch64_gnullvm"
version = "0.53.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764"
[[package]]
name = "windows_aarch64_msvc"
version = "0.48.5"
@@ -2133,12 +2118,6 @@ version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"
[[package]]
name = "windows_aarch64_msvc"
version = "0.53.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c"
[[package]]
name = "windows_i686_gnu"
version = "0.48.5"
@@ -2151,24 +2130,12 @@ version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b"
[[package]]
name = "windows_i686_gnu"
version = "0.53.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3"
[[package]]
name = "windows_i686_gnullvm"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"
[[package]]
name = "windows_i686_gnullvm"
version = "0.53.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11"
[[package]]
name = "windows_i686_msvc"
version = "0.48.5"
@@ -2181,12 +2148,6 @@ version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"
[[package]]
name = "windows_i686_msvc"
version = "0.53.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d"
[[package]]
name = "windows_x86_64_gnu"
version = "0.48.5"
@@ -2199,12 +2160,6 @@ version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78"
[[package]]
name = "windows_x86_64_gnu"
version = "0.53.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba"
[[package]]
name = "windows_x86_64_gnullvm"
version = "0.48.5"
@@ -2217,12 +2172,6 @@ version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d"
[[package]]
name = "windows_x86_64_gnullvm"
version = "0.53.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57"
[[package]]
name = "windows_x86_64_msvc"
version = "0.48.5"
@@ -2235,17 +2184,11 @@ version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
[[package]]
name = "windows_x86_64_msvc"
version = "0.53.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486"
[[package]]
name = "winnow"
version = "0.7.11"
version = "0.7.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "74c7b26e3480b707944fc872477815d29a8e429d2f93a1ce000f5fa84a15cbcd"
checksum = "5a5364e9d77fcdeeaa6062ced926ee3381faa2ee02d3eb83a5c27a8825540829"
[[package]]
name = "wit-bindgen-rt"
+16 -17
View File
@@ -6,12 +6,12 @@ homepage = "https://github.com/sharkdp/bat"
license = "MIT OR Apache-2.0"
name = "bat"
repository = "https://github.com/sharkdp/bat"
version = "0.26.0"
version = "0.26.1"
exclude = ["assets/syntaxes/*", "assets/themes/*"]
build = "build/main.rs"
edition = '2021'
# You are free to bump MSRV as soon as a reason for bumping emerges.
rust-version = "1.79"
rust-version = "1.87"
[features]
default = ["application", "git"]
@@ -42,16 +42,16 @@ regex-onig = ["syntect/regex-onig"] # Use the "oniguruma" regex engine
regex-fancy = ["syntect/regex-fancy"] # Use the rust-only "fancy-regex" engine
[dependencies]
nu-ansi-term = "0.50.0"
nu-ansi-term = "0.50.3"
ansi_colours = "^1.2"
bincode = "1.0"
console = "0.16.0"
console = "0.16.2"
flate2 = "1.1"
once_cell = "1.20"
thiserror = "2.0"
wild = { version = "2.2", optional = true }
content_inspector = "0.2.4"
shell-words = { version = "1.1.0", optional = true }
shell-words = { version = "1.1.1", optional = true }
minus = { version = "5.6", optional = true, features = [
"dynamic_output",
"search",
@@ -65,13 +65,13 @@ semver = "1.0"
path_abs = { version = "0.5", default-features = false }
clircle = { version = "0.6.1", default-features = false }
bugreport = { version = "0.5.0", optional = true }
etcetera = { version = "0.10.0", optional = true }
grep-cli = { version = "0.1.11", optional = true }
regex = { version = "1.10.6", optional = true }
etcetera = { version = "0.11.0", optional = true }
grep-cli = { version = "0.1.12", optional = true }
regex = { version = "1.12.2", optional = true }
walkdir = { version = "2.5", optional = true }
bytesize = { version = "1.3.0" }
encoding_rs = "0.8.35"
execute = { version = "0.2.13", optional = true }
execute = { version = "0.2.15", optional = true }
terminal-colorsaurus = "1.0"
unicode-segmentation = "1.12.0"
itertools = "0.14.0"
@@ -92,16 +92,15 @@ optional = true
features = ["wrap_help", "cargo"]
[target.'cfg(target_os = "macos")'.dependencies]
home = "0.5.9"
plist = "1.7.0"
[dev-dependencies]
assert_cmd = "2.0.12"
assert_cmd = "2.0.16"
expect-test = "1.5.0"
serial_test = { version = "2.0.0", default-features = false }
predicates = "3.1.3"
wait-timeout = "0.2.1"
tempfile = "3.16.0"
tempfile = "3.23.0"
serde = { version = "1.0", features = ["derive"] }
[target.'cfg(unix)'.dev-dependencies]
@@ -112,15 +111,15 @@ anyhow = "1.0.97"
indexmap = { version = "2.8.0", features = ["serde"] }
itertools = "0.14.0"
once_cell = "1.20"
prettyplease = "0.2.35"
proc-macro2 = "1.0.95"
prettyplease = "0.2.37"
proc-macro2 = "1.0.103"
quote = "1.0.40"
regex = "1.10.6"
regex = "1.12.2"
serde = "1.0"
serde_derive = "1.0"
serde_with = { version = "3.12.0", default-features = false, features = ["macros"] }
serde_with = { version = "3.15.1", default-features = false, features = ["macros"] }
syn = { version = "2.0.104", features = ["full"] }
toml = { version = "0.9.1", features = ["preserve_order"] }
toml = { version = "0.9.8", features = ["preserve_order"] }
walkdir = "2.5"
[build-dependencies.clap]
+13 -18
View File
@@ -31,12 +31,6 @@ A special *thank you* goes to our biggest <a href="doc/sponsors.md">sponsors</a>
<br>
<sub>Available on MacOS, Linux, Windows</sub>
</a>
</p><p>
<a href="https://graphite.dev/?utm_source=github&utm_medium=repo&utm_campaign=bat">
<img src="doc/sponsors/graphite-logo.jpeg" width="200" alt="Graphite">
<br>
<strong>Graphite is the AI developer productivity platform helping<br>teams on GitHub ship higher quality software, faster</strong>
</a>
</p>
### Syntax highlighting
@@ -201,18 +195,13 @@ bat main.cpp | xclip
`MANPAGER` environment variable:
```bash
export MANPAGER="sh -c 'awk '\''{ gsub(/\x1B\[[0-9;]*m/, \"\", \$0); gsub(/.\x08/, \"\", \$0); print }'\'' | bat -p -lman'"
export MANPAGER="bat -plman"
man 2 select
```
(replace `bat` with `batcat` if you are on Debian or Ubuntu)
If you prefer to have this bundled in a new command, you can also use [`batman`](https://github.com/eth-p/bat-extras/blob/master/doc/batman.md).
> [!WARNING]
> This will [not work](https://github.com/sharkdp/bat/issues/1145) out of the box with Mandoc's `man` implementation.
>
> Please either use `batman`, or convert the shell script to a [shebang executable](https://en.wikipedia.org/wiki/Shebang_(Unix)) and point `MANPAGER` to that.
Note that the [Manpage syntax](assets/syntaxes/02_Extra/Manpage.sublime-syntax) is developed in this repository and still needs some work.
#### `prettier` / `shfmt` / `rustfmt`
@@ -540,6 +529,12 @@ variable to make these changes permanent or use `bat`'s
> Or, if you want to override the styles completely, you use `--style=numbers` to
> only show the line numbers.
### Decorations
By default, `bat` only shows decorations (such as line numbers, file headers, grid borders, etc.) when outputting to an interactive terminal. You can control this behavior with the `--decorations` option. Use `--decorations=always` to show decorations even when piping output to another command, or `--decorations=never` to disable them entirely. Possible values are `auto` (default), `never`, and `always`.
There is also the `--force-colorization` option, which is an alias for `--decorations=always --color=always`. This is useful if you want to keep colorization and decorations when piping `bat`'s output to another program.
### Adding new syntaxes / language definitions
Should you find that a particular syntax is not available within `bat`, you can follow these
@@ -670,22 +665,22 @@ to improve the experience. Specifically, `-R`/`--RAW-CONTROL-CHARS`, `-F`/`--qui
> - The `--paging=always` argument is used.
> - The `BAT_PAGING` environment is set to `always`.
The `-R` option is needed to interpret ANSI colors correctly.
The `-R`/`--RAW-CONTROL-CHARS` option is needed to interpret ANSI colors correctly.
The `-F` option instructs `less` to exit immediately if the output size is smaller than
The `-F`/`--quit-if-one-screen` option instructs `less` to exit immediately if the output size is smaller than
the vertical size of the terminal. This is convenient for small files because you do not
have to press `q` to quit the pager.
The `-K` option instructs `less` to exit immediately when an interrupt signal is received.
The `-K`/`--quit-on-intr` option instructs `less` to exit immediately when an interrupt signal is received.
This is useful to ensure that `less` quits together with `bat` on SIGINT.
The `-X` option is needed to fix a bug with the `--quit-if-one-screen` feature in versions
of `less` older than version 530. Unfortunately, it also breaks mouse-wheel support in `less`.
The `-X`/`--no-init` option is added to versions of `less` older than version 530 (older than 558 on Windows) to
fix a bug with the `-F`/`--quit-if-one-screen` feature. Unfortunately, it also breaks mouse-wheel support in `less`.
If you want to enable mouse-wheel scrolling on older versions of `less` and do not mind losing
the quit-if-one-screen feature, you can set the pager (via `--pager` or `BAT_PAGER`) to `less -R`.
For `less` 530 or newer, it should work out of the box.
The `-S` option is added when `bat`'s `-S`/`--chop-long-lines` option is used. This tells `less`
The `-S`/`--chop-long-lines` option is added when `bat`'s `-S`/`--chop-long-lines` option is used. This tells `less`
to truncate any lines larger than the terminal width.
### Indentation
BIN
View File
Binary file not shown.
+4 -1
View File
@@ -49,7 +49,10 @@ Register-ArgumentCompleter -Native -CommandName '{{PROJECT_EXECUTABLE}}' -Script
}
'*;--language' {
Get-MyLanguages |
ForEach-Object {[CompletionResult]::new(($_.MyParameter -replace "^(.*)$", '''$1'''), $_.MyParameter, [CompletionResultType]::ParameterName, $_.MyDescription ?? '_no value_')}
ForEach-Object {
$desc = if ($null -eq $_.MyDescription) { '_no value_' } else { $_.MyDescription }
[CompletionResult]::new(($_.MyParameter -replace "^(.*)$", '''$1'''), $_.MyParameter, [CompletionResultType]::ParameterName, $desc)
}
break
}
'*;--theme' {
+30 -12
View File
@@ -14,18 +14,36 @@ __bat_escape_completions()
{
# Do not escape if completing a quoted value.
[[ $cur == [\"\']* ]] && return 0
# printf -v to an array index is available in bash >= 4.1.
# Use it if available, as -o filenames is semantically incorrect if
# we are not actually completing filenames, and it has side effects
# (e.g. adds trailing slash to candidates matching present dirs).
if ((
BASH_VERSINFO[0] > 5 || \
BASH_VERSINFO[0] == 5 && BASH_VERSINFO[1] >= 3
)); then
# bash >= 5.3 has "compopt -o fullquote", which exactly does
# what this function tries to do.
compopt -o fullquote
elif ((
BASH_VERSINFO[0] > 4 || \
BASH_VERSINFO[0] == 4 && BASH_VERSINFO[1] > 0
)); then
# printf -v to an array index is available in bash >= 4.1.
# Use it if available, as -o filenames is semantically
# incorrect if we are not actually completing filenames, and it
# has side effects (e.g. adds trailing slash to candidates
# matching present dirs).
local i
for i in ${!COMPREPLY[*]}; do
printf -v "COMPREPLY[i]" %q "${COMPREPLY[i]}"
done
# We can use "compopt -o noquote" available in bash >= 4.3 to
# prevent further quoting by the shell, which would be
# unexpectedly applied when a quoted result matches a filename.
if ((
BASH_VERSINFO[0] > 4 || \
BASH_VERSINFO[0] == 4 && BASH_VERSINFO[1] >= 3
)); then
compopt -o noquote
fi
else
compopt -o filenames
fi
@@ -66,7 +84,7 @@ _bat() {
printf "%s\n" "$lang"
done
)" -- "$cur"))
__bat_escape_completions
__bat_escape_completions
return 0
;;
-H | --highlight-line | \
@@ -130,16 +148,16 @@ _bat() {
return 0
;;
--theme)
local IFS=$'\n'
COMPREPLY=($(compgen -W "auto${IFS}auto:always${IFS}auto:system${IFS}dark${IFS}light${IFS}$("$1" --list-themes)" -- "$cur"))
__bat_escape_completions
return 0
;;
local IFS=$'\n'
COMPREPLY=($(compgen -W "auto${IFS}auto:always${IFS}auto:system${IFS}dark${IFS}light${IFS}$("$1" --list-themes)" -- "$cur"))
__bat_escape_completions
return 0
;;
--theme-dark | \
--theme-light)
local IFS=$'\n'
COMPREPLY=($(compgen -W "$("$1" --list-themes)" -- "$cur"))
__bat_escape_completions
__bat_escape_completions
return 0
;;
--style)
@@ -158,7 +176,7 @@ _bat() {
numbers
snip
)
# shellcheck disable=SC2016
# shellcheck disable=SC2016
if declare -F _comp_delimited >/dev/null 2>&1; then
# bash-completion > 2.11
_comp_delimited , -W '"${styles[@]}"'
+1 -1
View File
@@ -14,7 +14,7 @@ index e973e319..07c170a7 100644
first_line_match: |
(?x)
- ^\#! .* \b(bash|zsh|sh|tcsh|ash)\b
+ ^\#! .* \b(bash|zsh|sh|tcsh|ash|dash)\b
+ ^\#! .* \b(bash|zsh|sh|tcsh|ash|dash|ksh)\b
| ^\# \s* -\*- [^*]* mode: \s* shell-script [^*]* -\*-
#-------------------------------------------------------------------------------
BIN
View File
Binary file not shown.
+1 -1
View File
@@ -79,7 +79,7 @@ contexts:
double_quoted_string:
- meta_include_prototype: false
- meta_scope: string.quoted.double.csv
- meta_scope: meta.string.quoted.double.csv
- match: '""'
scope: constant.character.escape.csv
- match: '"'
+3 -3
View File
@@ -6,12 +6,12 @@ if you are not looking for a program like `bat`, this comparison might not be fo
| | bat | [pygments](http://pygments.org/) | [highlight](http://www.andre-simon.de/doku/highlight/highlight.php) | [ccat](https://github.com/jingweno/ccat) | [source-highlight](https://www.gnu.org/software/src-highlite/) | [hicat](https://github.com/rstacruz/hicat) | [coderay](https://github.com/rubychan/coderay) | [rouge](https://github.com/jneen/rouge) | [clp](https://github.com/jpe90/clp) |
|----------------------------------------------|---------------------------------------------------------------------|----------------------------------|---------------------------------------------------------------------|------------------------------------------|----------------------------------------------------------------|-----------------------------------------------------|-----------------------------------------------------|-----------------------------------------------------|-----------------------------------------------------|
| Drop-in `cat` replacement | :heavy_check_mark: [*](https://github.com/sharkdp/bat/issues/134) | :x: | :x: | (:heavy_check_mark:) | :x: | :x: [*](https://github.com/rstacruz/hicat/issues/6) | :x: | :x: | :x: |
| Drop-in `cat` replacement | :heavy_check_mark:&nbsp;[*](https://github.com/sharkdp/bat/issues/134) | :x: | :x: | (✔️) | :x: | :x:&nbsp;[*](https://github.com/rstacruz/hicat/issues/6) | :x: | :x: | :x: |
| Git integration | :heavy_check_mark: | :x: | :x: | :x: | :x: | :x: | :x: | :x: | :x: |
| Automatic paging | :heavy_check_mark: | :x: | :x: | :x: | :x: | :heavy_check_mark: | :x: | :x: | :x: |
| Languages (circa) | 150 | 300 | 200 | 7 | 80 | 130 | 30 | 130 | 150 |
| Extensible (languages, themes) | :heavy_check_mark: | (:heavy_check_mark:) | (:heavy_check_mark:) | :x: | (:heavy_check_mark:) | :x: | :x: | :x: | :heavy_check_mark: |
| Advanced highlighting (e.g. nested syntaxes) | :heavy_check_mark: | :heavy_check_mark: | (:heavy_check_mark:) ? | :x: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
| Extensible (languages, themes) | :heavy_check_mark: | (✔️) | (✔️) | :x: | (✔️) | :x: | :x: | :x: | :heavy_check_mark: |
| Advanced highlighting (e.g. nested syntaxes) | :heavy_check_mark: | :heavy_check_mark: | (✔️) ? | :x: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
| Execution time [ms] (`jquery-3.3.1.js`) | 422 | 455 | 299 | 39 | 208 | 287 | 128 | 740 | 22 |
| Execution time [ms] (`miniz.c`) | 27 | 169 | 19 | 4 | 36 | 131 | 58 | 231 | 4 |
| Execution time [ms] (957 kB XML file) | 215 | 296 | 236 | 165 | 83 | 412 | 135 | 386 | 127 |
+1
View File
@@ -194,6 +194,7 @@ Options:
'--line-range :40' prints lines 1 to 40
'--line-range 40:' prints lines 40 to the end of the file
'--line-range 40' only prints line 40
'--line-range -10:' prints the last 10 lines
'--line-range 30:+10' prints lines 30 to 40
'--line-range 35::5' prints lines 30 to 40 (line 35 with 5 lines of context)
'--line-range 30:40:2' prints lines 28 to 42 (range 30-40 with 2 lines of context)
+209 -48
View File
@@ -38,9 +38,18 @@ pub fn env_no_color() -> bool {
env::var_os("NO_COLOR").is_some_and(|x| !x.is_empty())
}
enum HelpType {
Short,
Long,
}
pub struct App {
pub matches: ArgMatches,
interactive_output: bool,
/// True if -n / --number was passed on the command line
/// (not from config file or environment variables).
/// This is used to honor the flag when piping output, similar to `cat -n`.
number_from_cli: bool,
}
impl App {
@@ -50,65 +59,217 @@ impl App {
let interactive_output = std::io::stdout().is_terminal();
// Check if the -n / --number option was passed on the command line
// (before merging with config file and environment variables).
// This is needed to honor the -n flag when piping output, similar to `cat -n`.
// We need to handle both standalone (-n, --number) and combined short flags (-pn, -An, etc.)
// Note: We only check if -n appears and is not overridden by -p in the same combined flag.
// For combined flags like -np, -p comes after -n and overrides it, so we don't count it.
// For combined flags like -pn, -n comes after -p and takes effect.
let number_from_cli = wild::args_os().any(|arg| {
let arg_str = arg.to_string_lossy();
if arg_str == "-n" || arg_str == "--number" {
return true;
}
// Handle combined short flags
// Only count -n if it's the LAST flag in the combined form (so -p doesn't override it)
// or if -p is not present in the combined form
if arg_str.starts_with('-') && !arg_str.starts_with("--") && arg_str.len() > 2 {
let chars: Vec<char> = arg_str.chars().skip(1).collect();
let n_pos = chars.iter().position(|&c| c == 'n');
let p_pos = chars.iter().position(|&c| c == 'p');
// -n is in the combined flag and either:
// - -p is not present, OR
// - -n comes after -p (so -n takes effect)
if let Some(n) = n_pos {
if p_pos.is_none() || n > p_pos.unwrap() {
return true;
}
}
}
false
});
let matches = Self::matches(interactive_output)?;
if matches.get_flag("help") {
let help_type = if wild::args_os().any(|arg| arg == "--help") {
HelpType::Long
} else {
HelpType::Short
};
let use_pager = match matches.get_one::<String>("paging").map(|s| s.as_str()) {
Some("never") => false,
_ => !matches.get_flag("no-paging"),
};
let use_color = match matches.get_one::<String>("color").map(|s| s.as_str()) {
Some("always") => true,
Some("never") => false,
_ => interactive_output, // auto: use color if interactive
};
let pager = matches.get_one::<String>("pager").map(|s| s.as_str());
let theme_options = Self::theme_options_from_matches(&matches);
let use_custom_assets = !matches.get_flag("no-custom-assets");
Self::display_help(
interactive_output,
help_type,
use_pager,
use_color,
pager,
theme_options,
use_custom_assets,
)?;
std::process::exit(0);
}
Ok(App {
matches: Self::matches(interactive_output)?,
matches,
interactive_output,
number_from_cli,
})
}
fn display_help(
interactive_output: bool,
help_type: HelpType,
use_pager: bool,
use_color: bool,
pager: Option<&str>,
theme_options: ThemeOptions,
use_custom_assets: bool,
) -> Result<()> {
use crate::assets::assets_from_cache_or_binary;
use crate::directories::PROJECT_DIRS;
use bat::{
config::Config,
controller::Controller,
input::Input,
style::{StyleComponent, StyleComponents},
theme::theme,
PagingMode,
};
let mut cmd = clap_app::build_app(interactive_output);
let help_text = match help_type {
HelpType::Short => cmd.render_help().to_string(),
HelpType::Long => cmd.render_long_help().to_string(),
};
let inputs: Vec<Input> = vec![Input::from_reader(Box::new(help_text.as_bytes()))];
let paging_mode = if use_pager {
PagingMode::QuitIfOneScreen
} else {
PagingMode::Never
};
let help_config = Config {
style_components: StyleComponents::new(StyleComponent::Plain.components(false)),
paging_mode,
pager,
colored_output: use_color,
true_color: use_color,
language: if use_color { Some("help") } else { None },
theme: theme(theme_options).to_string(),
..Default::default()
};
let cache_dir = PROJECT_DIRS.cache_dir();
let assets = assets_from_cache_or_binary(use_custom_assets, cache_dir)?;
Controller::new(&help_config, &assets)
.run(inputs, None)
.ok();
Ok(())
}
/// Build argument list with env vars and CLI args (without config file)
fn build_args_without_config() -> Vec<std::ffi::OsString> {
let mut cli_args = wild::args_os();
let mut args = get_args_from_env_vars();
// Put the zero-th CLI argument (program name) first
args.insert(0, cli_args.next().unwrap());
// .. and the rest at the end
cli_args.for_each(|a| args.push(a));
args
}
fn matches(interactive_output: bool) -> Result<ArgMatches> {
// Check if we should skip config file processing for special arguments
// that don't require full application setup (help, version, diagnostic)
// that don't require full application setup (version, diagnostic)
let should_skip_config = wild::args_os().any(|arg| {
matches!(
arg.to_str(),
Some("-h" | "--help" | "-V" | "--version" | "--diagnostic" | "--diagnostics")
Some("-V" | "--version" | "--diagnostic" | "--diagnostics")
)
});
let args = if wild::args_os().nth(1) == Some("cache".into()) {
// Check if help was requested - help should read the config file but be
// forgiving of invalid arguments (so configured theme etc. can be used)
let help_requested =
wild::args_os().any(|arg| matches!(arg.to_str(), Some("-h" | "--help")));
if wild::args_os().nth(1) == Some("cache".into()) {
// Skip the config file and env vars
let args = wild::args_os().collect::<Vec<_>>();
return Ok(clap_app::build_app(interactive_output).get_matches_from(args));
}
wild::args_os().collect::<Vec<_>>()
} else if wild::args_os().any(|arg| arg == "--no-config") || should_skip_config {
if wild::args_os().any(|arg| arg == "--no-config") || should_skip_config {
// Skip the arguments in bats config file when --no-config is present
// or when user requests help, version, or diagnostic information
// or when user requests version or diagnostic information
let args = Self::build_args_without_config();
return Ok(clap_app::build_app(interactive_output).get_matches_from(args));
}
let mut cli_args = wild::args_os();
let mut args = if should_skip_config {
// For special commands, don't even try to load env vars that might fail
vec![]
} else {
get_args_from_env_vars()
};
// Build arguments with config file
let mut cli_args = wild::args_os();
// Put the zero-th CLI argument (program name) first
args.insert(0, cli_args.next().unwrap());
// .. and the rest at the end
cli_args.for_each(|a| args.push(a));
args
} else {
let mut cli_args = wild::args_os();
// Read arguments from bats config file
let mut args = get_args_from_env_opts_var()
.unwrap_or_else(get_args_from_config_file)
.map_err(|_| "Could not parse configuration file")?;
// Selected env vars supersede config vars
args.extend(get_args_from_env_vars());
// Put the zero-th CLI argument (program name) first
args.insert(0, cli_args.next().unwrap());
// .. and the rest at the end
cli_args.for_each(|a| args.push(a));
args
// Read arguments from bats config file
let config_args = match get_args_from_env_opts_var() {
Some(result) => result,
None => get_args_from_config_file(),
};
Ok(clap_app::build_app(interactive_output).get_matches_from(args))
// For help, ignore config file parse errors (use empty config instead)
// For non-help, propagate the error
let mut args = if help_requested {
config_args.unwrap_or_default()
} else {
config_args.map_err(|_| "Could not parse configuration file")?
};
// Selected env vars supersede config vars
args.extend(get_args_from_env_vars());
// Put the zero-th CLI argument (program name) first
args.insert(0, cli_args.next().unwrap());
// .. and the rest at the end
cli_args.for_each(|a| args.push(a));
// For help, try parsing with config, and if clap fails (e.g., invalid
// argument in config), fall back to parsing without config file args
if help_requested {
let app = clap_app::build_app(interactive_output);
match app.try_get_matches_from(args) {
Ok(matches) => Ok(matches),
Err(_) => {
// Config has invalid arguments, fall back to just env vars + CLI args
let fallback_args = Self::build_args_without_config();
Ok(clap_app::build_app(interactive_output).get_matches_from(fallback_args))
}
}
} else {
Ok(clap_app::build_app(interactive_output).get_matches_from(args))
}
}
pub fn config(&self, inputs: &[Input]) -> Result<Config<'_>> {
@@ -244,7 +405,7 @@ impl App {
Some("character") => WrappingMode::Character,
Some("never") => WrappingMode::NoWrapping(true),
Some("auto") | None => {
if style_components.plain() {
if style_components.plain() && maybe_term_width.is_none() {
WrappingMode::NoWrapping(false)
} else {
WrappingMode::Character
@@ -277,8 +438,7 @@ impl App {
.map(|s| s.as_str())
== Some("always")
|| self.matches.get_flag("force-colorization")
|| self.matches.get_flag("number")
|| self.matches.contains_id("style") && !style_components.plain()),
|| self.number_from_cli),
tab_width: self
.matches
.get_one::<String>("tabs")
@@ -462,17 +622,18 @@ impl App {
}
fn theme_options(&self) -> ThemeOptions {
let theme = self
.matches
Self::theme_options_from_matches(&self.matches)
}
fn theme_options_from_matches(matches: &ArgMatches) -> ThemeOptions {
let theme = matches
.get_one::<String>("theme")
.map(|t| ThemePreference::from_str(t).unwrap())
.unwrap_or_default();
let theme_dark = self
.matches
let theme_dark = matches
.get_one::<String>("theme-dark")
.map(|t| ThemeName::from_str(t).unwrap());
let theme_light = self
.matches
let theme_light = matches
.get_one::<String>("theme-light")
.map(|t| ThemeName::from_str(t).unwrap());
ThemeOptions {
+19
View File
@@ -34,6 +34,8 @@ pub fn build_app(interactive_output: bool) -> Command {
.args_conflicts_with_subcommands(true)
.allow_external_subcommands(true)
.disable_help_subcommand(true)
.disable_help_flag(true)
.disable_version_flag(true)
.max_term_width(100)
.about("A cat(1) clone with wings.")
.long_about("A cat(1) clone with syntax highlighting and Git integration.")
@@ -519,6 +521,7 @@ pub fn build_app(interactive_output: bool) -> Command {
.short('r')
.action(ArgAction::Append)
.value_name("N:M")
.allow_hyphen_values(true)
.help("Only print the lines from N to M.")
.long_help(
"Only print the specified range of lines for each file. \
@@ -527,6 +530,7 @@ pub fn build_app(interactive_output: bool) -> Command {
'--line-range :40' prints lines 1 to 40\n \
'--line-range 40:' prints lines 40 to the end of the file\n \
'--line-range 40' only prints line 40\n \
'--line-range -10:' prints the last 10 lines\n \
'--line-range 30:+10' prints lines 30 to 40\n \
'--line-range 35::5' prints lines 30 to 40 (line 35 with 5 lines of context)\n \
'--line-range 30:40:2' prints lines 28 to 42 (range 30-40 with 2 lines of context)",
@@ -652,6 +656,21 @@ pub fn build_app(interactive_output: bool) -> Command {
.action(ArgAction::SetTrue)
.hide_short_help(true)
.help("Sets terminal title to filenames when using a pager."),
)
.arg(
Arg::new("help")
.short('h')
.long("help")
.action(ArgAction::SetTrue)
.help("Print help (see more with '--help')")
.long_help("Print help (see a summary with '-h')"),
)
.arg(
Arg::new("version")
.long("version")
.short('V')
.action(ArgAction::Version)
.help("Print version"),
);
// Check if the current directory contains a file name cache. Otherwise,
+19 -16
View File
@@ -16,7 +16,7 @@ use std::io::{BufReader, Write};
use std::path::Path;
use std::process;
use bat::output::OutputType;
use bat::output::{OutputHandle, OutputType};
use bat::theme::DetectColorScheme;
use nu_ansi_term::Color::Green;
use nu_ansi_term::Style;
@@ -206,11 +206,10 @@ pub fn list_themes(
config.language = Some("Rust");
config.style_components = StyleComponents(style);
let mut output_type =
OutputType::from_mode(config.paging_mode, config.wrapping_mode, config.pager)?;
let mut writer = output_type.handle()?;
let default_theme_name = default_theme(color_scheme(detect_color_scheme).unwrap_or_default());
let mut buf = String::new();
let mut handle = OutputHandle::FmtWrite(&mut buf);
for theme in assets.themes() {
let default_theme_info = if default_theme_name == theme {
" (default)"
@@ -221,35 +220,39 @@ pub fn list_themes(
} else {
""
};
if config.colored_output {
writeln!(
writer,
"Theme: {}{default_theme_info}\n",
handle.write_fmt(format_args!(
"{}{default_theme_info}\n\n",
Style::new().bold().paint(theme.to_string()),
)?;
))?;
config.theme = theme.to_string();
Controller::new(&config, &assets)
.run(vec![theme_preview_file()], Some(&mut writer))
.run(vec![theme_preview_file()], Some(&mut handle))
.ok();
writeln!(writer)?;
handle.write_fmt(format_args!("\n"))?;
} else if config.loop_through {
writeln!(writer, "{theme}")?;
handle.write_fmt(format_args!("{theme}\n"))?;
} else {
writeln!(writer, "{theme}{default_theme_info}")?;
handle.write_fmt(format_args!("{theme}{default_theme_info}\n"))?;
}
}
if config.colored_output {
writeln!(
writer,
handle.write_fmt(format_args!(
"Further themes can be installed to '{}', \
and are added to the cache with `bat cache --build`. \
For more information, see:\n\n \
https://github.com/sharkdp/bat#adding-new-themes",
config_dir.join("themes").to_string_lossy()
)?;
))?;
}
let mut output_type =
OutputType::from_mode(config.paging_mode, config.wrapping_mode, config.pager)?;
let mut writer = output_type.handle()?;
writer.write_fmt(format_args!("{buf}"))?;
Ok(())
}
+86 -3
View File
@@ -99,13 +99,13 @@ pub struct Config<'a> {
#[cfg(feature = "lessopen")]
pub use_lessopen: bool,
// Weather or not to set terminal title when using a pager
// Whether or not to set terminal title when using a pager
pub set_terminal_title: bool,
/// The maximum number of consecutive empty lines to display
pub squeeze_lines: Option<usize>,
// Weather or not to set terminal title when using a pager
// Whether or not to strip ANSI escape codes from the input
pub strip_ansi: StripAnsiMode,
}
@@ -114,7 +114,13 @@ pub fn get_pager_executable(config_pager: Option<&str>) -> Option<String> {
crate::pager::get_pager(config_pager)
.ok()
.flatten()
.map(|pager| pager.bin)
.and_then(|pager| {
if pager.kind != crate::pager::PagerKind::Builtin {
Some(pager.bin)
} else {
None
}
})
}
#[test]
@@ -141,3 +147,80 @@ fn default_config_should_highlight_no_lines() {
RangeCheckResult::InRange
);
}
#[cfg(all(feature = "minimal-application", feature = "paging"))]
#[test]
fn get_pager_executable_with_config_pager_less() {
let result = get_pager_executable(Some("less"));
assert_eq!(result, Some("less".to_string()));
}
#[cfg(all(feature = "minimal-application", feature = "paging"))]
#[test]
fn get_pager_executable_with_config_pager_builtin() {
let result = get_pager_executable(Some("builtin"));
assert_eq!(result, None);
}
#[cfg(all(feature = "minimal-application", feature = "paging"))]
#[test]
fn get_pager_executable_with_config_pager_more() {
let result = get_pager_executable(Some("more"));
assert_eq!(result, Some("more".to_string()));
}
#[cfg(all(feature = "minimal-application", feature = "paging"))]
#[test]
fn get_pager_executable_with_bat_pager() {
std::env::set_var("BAT_PAGER", "most");
let result = get_pager_executable(None);
assert_eq!(result, Some("most".to_string()));
std::env::remove_var("BAT_PAGER");
}
#[cfg(all(feature = "minimal-application", feature = "paging"))]
#[test]
fn get_pager_executable_with_pager_more_switches_to_less() {
std::env::set_var("PAGER", "more");
let result = get_pager_executable(None);
assert_eq!(result, Some("less".to_string()));
std::env::remove_var("PAGER");
}
#[cfg(all(feature = "minimal-application", feature = "paging"))]
#[test]
fn get_pager_executable_default() {
// Ensure no env vars
std::env::remove_var("BAT_PAGER");
std::env::remove_var("PAGER");
let result = get_pager_executable(None);
assert_eq!(result, Some("less".to_string()));
}
#[cfg(all(feature = "minimal-application", feature = "paging"))]
#[test]
fn get_pager_executable_name_ignoring_arguments() {
let result = get_pager_executable(Some("foo --bar"));
assert_eq!(result, Some("foo".to_string()));
}
#[cfg(all(feature = "minimal-application", feature = "paging"))]
#[test]
fn get_pager_executable_name_ignoring_path() {
let result = get_pager_executable(Some("/bin/foo test"));
assert_eq!(result, Some("/bin/foo".to_string()));
}
#[cfg(all(feature = "minimal-application", feature = "paging"))]
#[test]
fn get_pager_executable_invalid_command() {
let result = get_pager_executable(Some("invalid ' command"));
assert_eq!(result, None);
}
#[cfg(all(feature = "minimal-application", feature = "paging"))]
#[test]
fn get_pager_executable_empty_config() {
let result = get_pager_executable(Some(""));
assert_eq!(result, None);
}
+22 -10
View File
@@ -50,10 +50,12 @@ impl Controller<'_> {
output_handle: Option<&mut OutputHandle<'_>>,
mut handle_error: impl FnMut(&Error, &mut dyn Write),
) -> Result<bool> {
let mut output_type;
// only create our own OutputType if no output handle was provided.
#[allow(unused_mut)]
let mut output_type_opt: Option<OutputType> = None;
#[cfg(feature = "paging")]
{
if output_handle.is_none() {
use crate::input::InputKind;
use std::path::Path;
@@ -74,25 +76,35 @@ impl Controller<'_> {
let wrapping_mode = self.config.wrapping_mode;
output_type = OutputType::from_mode(paging_mode, wrapping_mode, self.config.pager)?;
output_type_opt = Some(OutputType::from_mode(
paging_mode,
wrapping_mode,
self.config.pager,
)?);
}
#[cfg(not(feature = "paging"))]
{
output_type = OutputType::stdout();
if output_handle.is_none() {
output_type_opt = Some(OutputType::stdout());
}
let attached_to_pager = output_type.is_pager();
let attached_to_pager = match (&output_handle, &output_type_opt) {
(Some(_), _) => true,
(None, Some(ot)) => ot.is_pager(),
(None, None) => false,
};
let stdout_identifier = if cfg!(windows) || attached_to_pager {
None
} else {
clircle::Identifier::stdout()
};
let mut writer = match output_handle {
Some(OutputHandle::FmtWrite(w)) => OutputHandle::FmtWrite(w),
Some(OutputHandle::IoWrite(w)) => OutputHandle::IoWrite(w),
None => output_type.handle()?,
let mut writer = match (output_handle, &mut output_type_opt) {
(Some(OutputHandle::FmtWrite(w)), _) => OutputHandle::FmtWrite(w),
(Some(OutputHandle::IoWrite(w)), _) => OutputHandle::IoWrite(w),
(None, Some(ot)) => ot.handle()?,
(None, None) => unreachable!("No output handle and no output type available"),
};
let mut no_errors: bool = true;
let stderr = io::stderr();
+11 -9
View File
@@ -141,16 +141,18 @@ impl OutputType {
//
// For newer versions (530 or 558 on Windows), we omit '--no-init' as it
// is not needed anymore.
match retrieve_less_version(&pager.bin) {
None => {
p.arg("--no-init");
if single_screen_action == SingleScreenAction::Quit {
match retrieve_less_version(&pager.bin) {
None => {
p.arg("--no-init");
}
Some(LessVersion::Less(version))
if (version < 530 || (cfg!(windows) && version < 558)) =>
{
p.arg("--no-init");
}
_ => {}
}
Some(LessVersion::Less(version))
if (version < 530 || (cfg!(windows) && version < 558)) =>
{
p.arg("--no-init");
}
_ => {}
}
} else {
p.args(args);
+50
View File
@@ -149,6 +149,35 @@ pub fn strip_ansi(line: &str) -> String {
buffer
}
/// Strips overstrike sequences (backspace formatting) from input.
///
/// Overstrike formatting is used by man pages and some help output:
/// - Bold: `X\x08X` (character, backspace, same character)
/// - Underline: `_\x08X` (underscore, backspace, character)
///
/// This function removes these sequences, keeping only the visible character.
/// `first_backspace` is the position of the first backspace in the line.
pub fn strip_overstrike(line: &str, first_backspace: usize) -> String {
let mut output = String::with_capacity(line.len());
output.push_str(&line[..first_backspace]);
output.pop();
let mut remaining = &line[first_backspace + 1..];
loop {
if let Some(pos) = remaining.find('\x08') {
output.push_str(&remaining[..pos]);
output.pop();
remaining = &remaining[pos + 1..];
} else {
output.push_str(remaining);
break;
}
}
output
}
#[derive(Debug, PartialEq, Clone, Copy, Default)]
pub enum StripAnsiMode {
#[default]
@@ -211,3 +240,24 @@ fn test_strip_ansi() {
"multiple sequences"
);
}
#[test]
fn test_strip_overstrike() {
// Bold: X\x08X (same char repeated)
assert_eq!(strip_overstrike("H\x08Hello", 1), "Hello");
// Underline: _\x08X (underscore before char)
assert_eq!(strip_overstrike("_\x08Hello", 1), "Hello");
// Multiple overstrike sequences
assert_eq!(strip_overstrike("B\x08Bo\x08ol\x08ld\x08d", 1), "Bold");
// Backspace at start of line (nothing to pop)
assert_eq!(strip_overstrike("\x08Hello", 0), "Hello");
// Multiple consecutive backspaces
assert_eq!(strip_overstrike("ABC\x08\x08\x08XYZ", 3), "XYZ");
// Unicode with overstrike
assert_eq!(strip_overstrike("ä\x08äöü", 2), "äöü");
}
+16 -4
View File
@@ -29,8 +29,7 @@ use crate::error::*;
use crate::input::OpenedInput;
use crate::line_range::{MaxBufferedLineNumber, RangeCheckResult};
use crate::output::OutputHandle;
use crate::preprocessor::strip_ansi;
use crate::preprocessor::{expand_tabs, replace_nonprintable};
use crate::preprocessor::{expand_tabs, replace_nonprintable, strip_ansi, strip_overstrike};
use crate::style::StyleComponent;
use crate::terminal::{as_terminal_escaped, to_ansi_color};
use crate::vscreen::{AnsiStyle, EscapeSequence, EscapeSequenceIterator};
@@ -199,6 +198,7 @@ pub(crate) struct InteractivePrinter<'a> {
background_color_highlight: Option<Color>,
consecutive_empty_lines: usize,
strip_ansi: bool,
strip_overstrike: bool,
}
impl<'a> InteractivePrinter<'a> {
@@ -263,17 +263,22 @@ impl<'a> InteractivePrinter<'a> {
|| matches!(config.binary, BinaryBehavior::AsText))
&& (config.colored_output || config.strip_ansi == StripAnsiMode::Auto);
let (is_plain_text, highlighter_from_set) = if needs_to_match_syntax {
let (is_plain_text, strip_overstrike, highlighter_from_set) = if needs_to_match_syntax {
// Determine the type of syntax for highlighting
const PLAIN_TEXT_SYNTAX: &str = "Plain Text";
const MANPAGE_SYNTAX: &str = "Manpage";
const COMMAND_HELP_SYNTAX: &str = "Command Help";
match assets.get_syntax(config.language, input, &config.syntax_mapping) {
Ok(syntax_in_set) => (
syntax_in_set.syntax.name == PLAIN_TEXT_SYNTAX,
syntax_in_set.syntax.name == MANPAGE_SYNTAX
|| syntax_in_set.syntax.name == COMMAND_HELP_SYNTAX,
Some(HighlighterFromSet::new(syntax_in_set, theme)),
),
Err(Error::UndetectedSyntax(_)) => (
true,
false,
Some(
assets
.find_syntax_by_name(PLAIN_TEXT_SYNTAX)?
@@ -285,7 +290,7 @@ impl<'a> InteractivePrinter<'a> {
Err(e) => return Err(e),
}
} else {
(false, None)
(false, false, None)
};
// Determine when to strip ANSI sequences
@@ -310,6 +315,7 @@ impl<'a> InteractivePrinter<'a> {
background_color_highlight,
consecutive_empty_lines: 0,
strip_ansi,
strip_overstrike,
})
}
@@ -622,6 +628,12 @@ impl Printer for InteractivePrinter<'_> {
}
};
if self.strip_overstrike {
if let Some(pos) = line.find('\x08') {
line = strip_overstrike(&line, pos).into();
}
}
// If ANSI escape sequences are supposed to be stripped, do it before syntax highlighting.
if self.strip_ansi {
line = strip_ansi(&line).into()
@@ -1,5 +1,5 @@
# see `man quadlet`
[mappings]
"INI" = [
"**/containers/systemd/**/*.{container,volume,network,kube,image}",
"**/containers/systemd/**/*.{container,volume,network,kube,image,build,pod,artifact}",
]
+1 -1
View File
@@ -288,7 +288,7 @@ fn color_scheme_from_system() -> Option<ColorScheme> {
const PREFERENCES_FILE: &str = "Library/Preferences/.GlobalPreferences.plist";
const STYLE_KEY: &str = "AppleInterfaceStyle";
let preferences_file = home::home_dir()
let preferences_file = std::env::home_dir()
.map(|home| home.join(PREFERENCES_FILE))
.expect("Could not get home directory");
-1
View File
@@ -34,7 +34,6 @@ fn all_themes_are_present() {
"Solarized (light)",
"Sublime Snazzy",
"TwoDark",
"Visual Studio Dark+",
"ansi",
"base16",
"base16-256",
+30
View File
@@ -0,0 +1,30 @@
GIT-COMMIT(1) Git Manual GIT-COMMIT(1)
NNAAMMEE
git-commit - Record changes to the repository
SSYYNNOOPPSSIISS
ggiitt ccoommmmiitt [--aa | ----iinntteerraaccttiivvee | ----ppaattcchh] [--ss] [--vv] [--uu[_<_m_o_d_e_>]] [----aammeenndd]
[----ddrryy--rruunn] [(--cc | --CC | ----ssqquuaasshh) _<_c_o_m_m_i_t_> | ----ffiixxuupp [(aammeenndd|rreewwoorrdd)::]_<_c_o_m_m_i_t_>]
[--FF _<_f_i_l_e_> | --mm _<_m_s_g_>] [----rreesseett--aauutthhoorr] [----aallllooww--eemmppttyy]
[----aallllooww--eemmppttyy--mmeessssaaggee] [----nnoo--vveerriiffyy] [--ee] [----aauutthhoorr==_<_a_u_t_h_o_r_>]
[----ddaattee==_<_d_a_t_e_>] [----cclleeaannuupp==_<_m_o_d_e_>] [----[nnoo--]ssttaattuuss]
[--ii | --oo] [----ppaatthhssppeecc--ffrroomm--ffiillee==_<_f_i_l_e_> [----ppaatthhssppeecc--ffiillee--nnuull]]
[(----ttrraaiilleerr _<_t_o_k_e_n_>[(==|::)_<_v_a_l_u_e_>])...] [--SS[_<_k_e_y_i_d_>]]
[----] [_<_p_a_t_h_s_p_e_c_>...]
DDEESSCCRRIIPPTTIIOONN
Create a new commit containing the current contents of the index and
the given log message describing the changes. The new commit is a
direct child of HEAD, usually the tip of the current branch, and the
branch is updated to point to it (unless no branch is associated with
the working tree, in which case HHEEAADD is "detached" as described in ggiitt--
cchheecckkoouutt(1)).
The content to be committed can be specified in several ways:
1. by using ggiitt--aadddd(1) to incrementally "add" changes to the index
before using the ccoommmmiitt command (Note: even modified files must be
"added");
2. by using ggiitt--rrmm(1) to remove files from the working tree and the
+1
View File
@@ -0,0 +1 @@
BBold tteexxtt and _u_n_d_e_r_l_i_n_e
+282 -37
View File
@@ -166,6 +166,53 @@ fn line_numbers() {
.stdout(" 1 line 1\n 2 line 2\n 3 line 3\n 4 line 4\n 5 line 5\n 6 line 6\n 7 line 7\n 8 line 8\n 9 line 9\n 10 line 10\n");
}
// Test that -n on command line shows line numbers even when piping (similar to `cat -n`)
#[test]
fn line_numbers_from_cli_in_loop_through_mode() {
bat()
.arg("multiline.txt")
.arg("-n")
.assert()
.success()
.stdout(" 1 line 1\n 2 line 2\n 3 line 3\n 4 line 4\n 5 line 5\n 6 line 6\n 7 line 7\n 8 line 8\n 9 line 9\n 10 line 10\n");
}
#[test]
fn style_from_env_var_ignored_and_line_numbers_from_cli_in_loop_through_mode() {
bat()
.env("BAT_STYLE", "full")
.arg("multiline.txt")
.arg("-n")
.arg("--decorations=auto")
.assert()
.success()
.stdout(" 1 line 1\n 2 line 2\n 3 line 3\n 4 line 4\n 5 line 5\n 6 line 6\n 7 line 7\n 8 line 8\n 9 line 9\n 10 line 10\n");
}
#[test]
fn numbers_ignored_from_cli_when_followed_by_plain_in_loop_through_mode() {
bat()
.arg("multiline.txt")
.arg("-np")
.arg("--decorations=auto")
.assert()
.success()
.stdout(
"line 1\nline 2\nline 3\nline 4\nline 5\nline 6\nline 7\nline 8\nline 9\nline 10\n",
);
}
#[test]
fn numbers_honored_from_cli_when_preceeded_by_plain_in_loop_through_mode() {
bat()
.arg("multiline.txt")
.arg("-pn")
.arg("--decorations=auto")
.assert()
.success()
.stdout(" 1 line 1\n 2 line 2\n 3 line 3\n 4 line 4\n 5 line 5\n 6 line 6\n 7 line 7\n 8 line 8\n 9 line 9\n 10 line 10\n");
}
#[test]
fn line_range_2_3() {
bat()
@@ -207,7 +254,7 @@ fn line_range_from_back_last_two() {
}
#[test]
fn line_range_from_back_last_two_single_line() {
fn line_range_from_back_last_two_single_line_eq_sep() {
bat()
.arg("single-line.txt")
.arg("--line-range=-2:")
@@ -216,6 +263,17 @@ fn line_range_from_back_last_two_single_line() {
.stdout("Single Line");
}
#[test]
fn line_range_from_back_last_two_single_line_no_sep() {
bat()
.arg("single-line.txt")
.arg("--line-range")
.arg("-2:")
.assert()
.success()
.stdout("Single Line");
}
#[test]
fn line_range_first_two() {
bat()
@@ -404,26 +462,18 @@ fn piped_output_with_line_numbers_style_flag() {
.write_stdin("hello\nworld\n")
.assert()
.success()
.stdout(" 1 hello\n 2 world\n");
.stdout("hello\nworld\n");
}
#[test]
#[cfg(not(target_os = "windows"))]
fn piped_output_with_line_numbers_with_header_grid_style_flag() {
// style ignored because non-interactive
bat()
.arg("--style=header,grid,numbers")
.write_stdin("hello\nworld\n")
.assert()
.success()
.stdout(
"─────┬──────────────────────────────────────────────────────────────────────────
STDIN
1 hello
2 world
",
);
.stdout("hello\nworld\n");
}
#[test]
@@ -441,6 +491,7 @@ fn piped_output_with_auto_style() {
fn piped_output_with_default_style_flag() {
bat()
.arg("--style=default")
.arg("--decorations=always")
.write_stdin("hello\nworld\n")
.assert()
.success()
@@ -594,6 +645,44 @@ fn test_help(arg: &str, expect_file: &str) {
.assert_eq(&String::from_utf8_lossy(&assert.get_output().stdout));
}
#[test]
fn short_help_with_highlighting() {
bat()
.arg("-h")
.arg("--paging=never")
.arg("--color=always")
.assert()
.success()
.stdout(predicate::str::contains("\x1B["))
.stdout(predicate::str::contains("Usage:"))
.stdout(predicate::str::contains("Options:"));
}
#[test]
fn long_help_with_highlighting() {
bat()
.arg("--help")
.arg("--paging=never")
.arg("--color=always")
.assert()
.success()
.stdout(predicate::str::contains("\x1B["))
.stdout(predicate::str::contains("Usage:"))
.stdout(predicate::str::contains("Options:"));
}
#[test]
fn help_with_color_never() {
bat()
.arg("--help")
.arg("--color=never")
.arg("--paging=never")
.assert()
.success()
.stdout(predicate::str::contains("\x1B[").not())
.stdout(predicate::str::contains("Usage:"));
}
#[cfg(unix)]
fn setup_temp_file(content: &[u8]) -> io::Result<(PathBuf, tempfile::TempDir)> {
let dir = tempfile::tempdir().expect("Couldn't create tempdir");
@@ -1268,27 +1357,33 @@ fn disable_pager_if_pp_flag_comes_after_paging() {
}
#[test]
#[serial]
fn enable_pager_if_disable_paging_flag_comes_before_paging() {
bat()
.env("PAGER", "echo pager-output")
.arg("-P")
.arg("--paging=always")
.arg("test.txt")
.assert()
.success()
.stdout(predicate::eq("pager-output\n").normalize());
mocked_pagers::with_mocked_versions_of_more_and_most_in_path(|| {
bat()
.env("PAGER", mocked_pagers::from("echo pager-output"))
.arg("-P")
.arg("--paging=always")
.arg("test.txt")
.assert()
.success()
.stdout(predicate::str::contains("pager-output\n").normalize());
});
}
#[test]
#[serial]
fn enable_pager_if_pp_flag_comes_before_paging() {
bat()
.env("PAGER", "echo pager-output")
.arg("-pp")
.arg("--paging=always")
.arg("test.txt")
.assert()
.success()
.stdout(predicate::eq("pager-output\n").normalize());
mocked_pagers::with_mocked_versions_of_more_and_most_in_path(|| {
bat()
.env("PAGER", mocked_pagers::from("echo pager-output"))
.arg("-pp")
.arg("--paging=always")
.arg("test.txt")
.assert()
.success()
.stdout(predicate::str::contains("pager-output\n").normalize());
});
}
#[test]
@@ -1305,15 +1400,18 @@ fn paging_does_not_override_simple_plain() {
}
#[test]
#[serial]
fn simple_plain_does_not_override_paging() {
bat()
.env("PAGER", "echo pager-output")
.arg("--paging=always")
.arg("--plain")
.arg("test.txt")
.assert()
.success()
.stdout(predicate::eq("pager-output\n"));
mocked_pagers::with_mocked_versions_of_more_and_most_in_path(|| {
bat()
.env("PAGER", mocked_pagers::from("echo pager-output"))
.arg("--paging=always")
.arg("--plain")
.arg("test.txt")
.assert()
.success()
.stdout(predicate::str::contains("pager-output\n").normalize());
});
}
#[test]
@@ -1390,6 +1488,28 @@ fn help_works_with_invalid_config() {
.stdout(predicate::str::contains("A cat(1) clone with wings"));
}
#[test]
fn help_uses_valid_config() {
let tmp_dir = tempdir().expect("can create temporary directory");
let tmp_config_path = tmp_dir.path().join("valid-config.conf");
// Write a valid config file with an invalid theme (so we can see a warning)
std::fs::write(&tmp_config_path, "--theme=NonExistentThemeName123")
.expect("can write config file");
// --help should read the config file and try to use the theme
// (we'll see a warning about unknown theme. This is the easiest way to prove the theme is read from config.)
bat_with_config()
.env("BAT_CONFIG_PATH", tmp_config_path.to_str().unwrap())
.arg("--help")
.assert()
.success()
.stdout(predicate::str::contains(
"A cat(1) clone with syntax highlighting",
))
.stderr(predicate::str::contains("Unknown theme"));
}
#[test]
fn version_works_with_invalid_config() {
let tmp_dir = tempdir().expect("can create temporary directory");
@@ -1550,7 +1670,7 @@ Clearing metadata file ... okay",
#[cfg(unix)]
#[test]
fn cache_build() {
fn cache_build_blank() {
let src_dir = "cache_source";
let tmp_dir = tempdir().expect("can create temporary directory");
let tmp_themes_path = tmp_dir.path().join("themes.bin");
@@ -1593,6 +1713,50 @@ Writing metadata to folder .* ... okay",
assert!(tmp_metadata_path.exists());
}
#[cfg(unix)]
#[test]
fn cache_build() {
let src_dir = "cache_source";
let tmp_dir = tempdir().expect("can create temporary directory");
let tmp_themes_path = tmp_dir.path().join("themes.bin");
let tmp_syntaxes_path = tmp_dir.path().join("syntaxes.bin");
let tmp_acknowledgements_path = tmp_dir.path().join("acknowledgements.bin");
let tmp_metadata_path = tmp_dir.path().join("metadata.yaml");
// Build the cache
// Include the BAT_CONFIG_PATH and BAT_THEME environment variables to ensure that
// options loaded from a config or the environment are not inserted
// before the cache subcommand, which would break it.
bat_with_config()
.current_dir(Path::new(EXAMPLES_DIR).join(src_dir))
.env("BAT_CONFIG_PATH", "bat.conf")
.env("BAT_THEME", "1337")
.arg("cache")
.arg("--build")
// removed --blank
.arg("--source")
.arg(".")
.arg("--target")
.arg(tmp_dir.path().to_str().unwrap())
.arg("--acknowledgements")
.assert()
.success()
.stdout(
predicate::str::is_match(
"Writing theme set to .*/themes.bin ... okay\nWriting syntax set to .*/syntaxes.bin ... okay\nWriting acknowledgements to .*/acknowledgements.bin ... okay\nWriting metadata to folder .* ... okay",
)
.unwrap(),
)
.stdout(predicate::str::contains("Some referenced contexts could not be found!").not())
;
// Now we expect the files to exist. If they exist, we assume contents are correct
assert!(tmp_themes_path.exists());
assert!(tmp_syntaxes_path.exists());
assert!(tmp_acknowledgements_path.exists());
assert!(tmp_metadata_path.exists());
}
#[test]
fn utf16() {
// The output will be converted to UTF-8 with the leading UTF-16
@@ -2386,6 +2550,73 @@ fn binary_as_text() {
.stderr("");
}
#[test]
fn no_strip_overstrike_for_plain_text() {
// Overstrike is preserved for plain text files (no syntax highlighting)
bat()
.arg("--color=never")
.arg("--decorations=never")
.arg("overstrike.txt")
.assert()
.success()
.stdout("B\x08Bold t\x08te\x08ex\x08xt\x08t and _\x08u_\x08n_\x08d_\x08e_\x08r_\x08l_\x08i_\x08n_\x08e\n")
.stderr("");
}
#[test]
fn strip_overstrike_with_syntax_highlighting() {
// Overstrike is stripped for certain syntax highlighting like command help.
bat()
.arg("--force-colorization")
.arg("--language=help")
.arg("overstrike.txt")
.assert()
.success()
.stdout(predicate::str::contains("Bold text and underline"))
.stderr("");
}
#[test]
fn strip_overstrike_for_manpage_syntax() {
// Overstrike is stripped for .man files (Manpage syntax)
bat()
.arg("--force-colorization")
.arg("git-commit.man")
.assert()
.success()
.stdout(predicate::str::contains("NAME"))
.stdout(predicate::str::contains("git-commit - Record changes"))
.stdout(predicate::str::is_match(r"\x1b\[38;[0-9;]+m--interactive\x1b\[").unwrap())
.stderr("");
}
#[test]
fn no_strip_overstrike_for_other_syntax() {
// Overstrike is NOT stripped for other syntaxes (e.g., Rust)
bat()
.arg("--force-colorization")
.arg("--language=rust")
.arg("overstrike.txt")
.assert()
.success()
.stdout(predicate::str::contains("\x08"))
.stderr("");
}
#[test]
fn show_all_shows_backspace_with_caret_notation() {
// --show-all should display backspace characters (not strip them)
bat()
.arg("--show-all")
.arg("--nonprintable-notation=caret")
.arg("--decorations=never")
.arg("overstrike.txt")
.assert()
.success()
.stdout(predicate::str::contains("^H"))
.stderr("");
}
#[test]
fn no_paging_arg() {
bat()
@@ -3409,3 +3640,17 @@ fn style_components_will_merge_with_env_var() {
.stdout(" STDIN\n 1 test\n")
.stderr("");
}
// Test for https://github.com/sharkdp/bat/issues/3526
#[test]
fn plain_with_sized_terminal_width() {
bat()
.arg("--plain")
.arg("--terminal-width=6")
.arg("--decorations=always")
.arg("test.txt")
.assert()
.success()
.stdout("hello \nworld\n")
.stderr("");
}
+2 -2
View File
@@ -1,5 +1,5 @@
with Chests.Ring_Buffers;
with USB.Device.HID.Keyboard;
with Chests.Ring_Buffers;
with USB.Device.HID.Keyboard;
package body Click is
 ----------------
+2 -2
View File
@@ -1,5 +1,5 @@
with HAL.GPIO;
with USB.Device.HID.Keyboard;
with HAL.GPIO;
with USB.Device.HID.Keyboard;
generic
 Nb_Bounce : Natural;
@@ -0,0 +1,19 @@
#!/bin/ksh
#
# https://www.qnx.com/developers/docs/6.4.0/neutrino/user_guide/scripts.html
# tfind:
# script to look for strings in various files and dump to less
case $# in
1)
 find . -name '*.[ch]' | xargs grep $1 | less
 exit 0 # good status
esac
echo "Use tfind stuff_to_find "
echo " where : stuff_to_find = search string "
echo " "
echo "e.g. tfind console_state looks through all files in " 
echo " the current directory and below and displays all "
echo " instances of console_state."
exit 1 # bad status
+5 -5
View File
@@ -1,7 +1,7 @@
first,last,address,city,zip
John,Doe,120 any st.,"Anytown, WW",08123
John,Doe,120 any st.,"Anytown, WW",08123
a,b
1,"ha 
""ha"" 
ha",120 any st.,"Anytown, WW",08123
3,4,120 any st.,"Anytown, WW",08123
1,"ha 
""ha"" 
ha",120 any st.,"Anytown, WW",08123
3,4,120 any st.,"Anytown, WW",08123
Can't render this file because it contains an unexpected character in line 2 and column 177.
+1 -1
View File
@@ -1,3 +1,3 @@
foo bar baz|;, test hello world tsv
1,2 1,7 2,7 a b c "hello again" tsv
";|," ;|, baz test "hello world" tsv
";|," ;|, baz test "hello world" tsv
Can't render this file because it contains an unexpected character in line 2 and column 218.
+19
View File
@@ -0,0 +1,19 @@
#!/bin/ksh
#
# https://www.qnx.com/developers/docs/6.4.0/neutrino/user_guide/scripts.html
# tfind:
# script to look for strings in various files and dump to less
case $# in
1)
find . -name '*.[ch]' | xargs grep $1 | less
exit 0 # good status
esac
echo "Use tfind stuff_to_find "
echo " where : stuff_to_find = search string "
echo " "
echo "e.g. tfind console_state looks through all files in "
echo " the current directory and below and displays all "
echo " instances of console_state."
exit 1 # bad status
+1 -10
View File
@@ -53,16 +53,7 @@ impl Default for BatTester {
fn default() -> Self {
let temp_dir = create_sample_directory().expect("sample directory");
let root = env::current_exe()
.expect("tests executable")
.parent()
.expect("tests executable directory")
.parent()
.expect("bat executable directory")
.to_path_buf();
let exe_name = if cfg!(windows) { "bat.exe" } else { "bat" };
let exe = root.join(exe_name);
let exe = assert_cmd::cargo::cargo_bin!("bat").to_path_buf();
BatTester { temp_dir, exe }
}
+1 -1
View File
@@ -4,7 +4,7 @@ use assert_cmd::cargo::CommandCargoExt;
use std::process::Command;
pub fn bat_raw_command_with_config() -> Command {
let mut cmd = Command::cargo_bin("bat").unwrap();
let mut cmd = Command::new(assert_cmd::cargo::cargo_bin!("bat"));
cmd.current_dir("tests/examples");
cmd.env_remove("BAT_CACHE_PATH");
cmd.env_remove("BAT_CONFIG_DIR");