1
0
mirror of https://github.com/sharkdp/bat.git synced 2025-06-15 21:05:45 +01:00
Commit Graph

2448 Commits

Author SHA1 Message Date
2dbc88d3af Improve bash completion escaping
`compopt -o filenames` is a cheap way to accomplish mostly wanted
behavior. However it is semantically incorrect when we are not actually
completing filenames, and has side effects -- for example adds a
trailing slash to candidates matching present dirs.

bash >= 4.1 can `printf -v` to an array index, use it instead where
available.
2022-09-11 21:54:22 +02:00
66edfe5dff Exclude --unbuffered from bash completions
It's a no-op, so there's little reason to suggest it.
2022-09-11 21:54:22 +02:00
c816188f97 Add --style argument bash completion 2022-09-11 21:54:22 +02:00
46bf3c1e9a Do not offer bash filename completions with --list-languages/-themes 2022-09-11 21:54:22 +02:00
066701d671 Add --acknowledgements and --ignored-suffix to bash completion 2022-09-11 21:54:22 +02:00
e96cdc3b95 Split bash completion option lists over multiple lines, sync sort with --help
For maintainability/diffability.
2022-09-11 21:54:22 +02:00
8bd5a88f07 Prepare a new "unreleased" section at the top of CHANGELOG.md 2022-09-10 20:39:33 +02:00
e5d9579614 Bump version to v0.22.1 v0.22.1 2022-09-10 17:59:33 +02:00
352309b056 Revert "Remove code that tries to handle ANSI escape inputs"
This reverts commit 8174e02279. Turns out
it is needed for a common use case, see
https://github.com/sharkdp/bat/issues/2307.

It is not a clean revert, because I adjust CHANGELOG.md and also add a
comment to the test. I also had to resolve a small `use` conflict.
2022-09-10 17:59:33 +02:00
6680f65e4b Add new 'unreleased' section, post v0.22 2022-09-06 23:11:06 +02:00
1f9519d8b9 Update binary assets v0.22.0 2022-09-06 22:54:20 +02:00
3c33b28507 Bump version to v0.22 2022-09-06 22:54:20 +02:00
08386daa3a Strip BOM from output in interactive mode ()
* Strip BOM from output in interactive mode

* Strip BOM when not loop_through, add regression tests

* Update CHANGELOG.md

* Only strip BOM from beginning of first line

* Fix integration test on macOS that relied on color scheme

* Fix integration test on Windows that relied on detected terminal width

* Fix syntax test that was failing due to a previously wrong (now fixed) highlighting

Co-authored-by: David Peter <mail@david-peter.de>
Co-authored-by: Martin Nordholts <enselic@gmail.com>
2022-09-06 19:08:38 +02:00
0e03dce130 Merge pull request from rhysd/issue-1919
Add `bat::PrettyPrinter::clear_highlights`
2022-09-06 09:32:29 +02:00
6a0ab0095a Add CHANGELOG entry 2022-09-06 09:32:06 +02:00
b213949aeb Correct doc comment for list_syntaxes_and_themes example 2022-09-05 21:57:11 +02:00
3d7817d662 Clear highlighted_lines when calling PrettyPrinter::print 2022-09-05 21:17:08 +09:00
abd69f2deb Add bat::PrettyPrinter::clear_highlights (fixes ) 2022-09-05 17:35:32 +09:00
113276a62b Merge pull request from kidonng/yaml
Map `fish_history` to YAML
2022-09-04 22:46:08 +02:00
Kid
1e1fa7cde5 CHANGELOG 2022-09-04 22:23:09 +02:00
Kid
d6d8b61131 Fix highlight test 2022-09-04 22:22:18 +02:00
Kid
839e62cff8 Map fish_history to YAML 2022-09-04 22:22:18 +02:00
ca9843fa83 Merge pull request from kidonng/patch-1
Add `.mts` and `.cts` to TypeScript file extensions
2022-09-04 22:20:02 +02:00
546dcf6a55 Merge pull request from patrickpichler/feature/668/add-systemwide-config
Add systemwide config file support
2022-09-04 22:11:17 +02:00
Kid
d7b6519422 Add .mts and .cts to TypeScript file extensions
See also:

https://github.com/github/linguist/pull/5905
2022-09-04 22:06:54 +02:00
799bb1639c Try to fix all warnings 2022-09-04 21:30:14 +02:00
bc2dc0796b Move up the entry to the unreleased section in CHANGELOG.md 2022-09-04 21:03:27 +02:00
2dd2994b2f Merge remote-tracking branch 'origin/master' into feature/668/add-systemwide-config 2022-09-04 20:44:23 +02:00
48541b8507 Fix clippy suggestions
Leads to a performance improvement for `bat -A`:

    | Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
    |:---|---:|---:|---:|---:|
    | `./bat-master --no-config -A ./bat-master` | 259.8 ± 1.1 | 258.4 | 261.7 | 1.15 ± 0.01 |
    | `./bat-2301 --no-config -A ./bat-master` | 225.6 ± 1.8 | 224.0 | 229.5 | 1.00 |
2022-09-04 14:28:44 +02:00
eab1c9eb46 update alternatives.md 2022-09-04 14:28:06 +02:00
c6775cc41e Syntax: [Log] scope whole line based on log level
to allow color schemes to color entire lines differently based on log level
2022-09-04 14:11:09 +02:00
45d6b1af3b Bump MSRV to 1.60
see https://github.com/rust-lang/git2-rs/issues/838
2022-09-04 06:04:35 +02:00
b295850cb3 Bump git2 from 0.14.2 to 0.15.0
Bumps [git2](https://github.com/rust-lang/git2-rs) from 0.14.2 to 0.15.0.
- [Release notes](https://github.com/rust-lang/git2-rs/releases)
- [Commits](https://github.com/rust-lang/git2-rs/compare/0.14.2...git2-curl-0.15.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-04 06:04:35 +02:00
08c91a116c refactor: Parse, don't validate 2022-09-03 14:01:56 +02:00
3d398b35c3 refactor: Switch from is_present to actions
Because "diff" is conditionally present, we need to check for it to
avoid some of clap's stricter checks meant to prevent bugs.
2022-09-03 14:01:56 +02:00
6099f2c146 refactor: Move off of value_of 2022-09-03 14:01:56 +02:00
50bb924ee3 refactor: Replace multiple_occurrences 2022-09-03 14:01:56 +02:00
e8e1c1d6c9 refactor: Replace allow_invalid_utf8 with PathBuf 2022-09-03 14:01:56 +02:00
542b3d2317 refactor: Resolve basic clap deprecations 2022-09-03 14:01:56 +02:00
2323804f7e refactor: Port to clap3
Ths does remove the specialization of version's description.  The way
this is done (internally through `mut_arg`) doesn't play well with
subcommands.  Clap tries to force this version of `version` into the
subcommand despite not being needed.  Clap v4 dramatically changes how
version customization works.

clap also does more error checks now to prevent programmer mistake, so
we can't have a conflict with an argument that is conditionally there,
so I swapped the condition.
2022-09-03 14:01:56 +02:00
49875d6ce7 Make bat::PrettyPrinter::syntaxes() iterate over new bat::Syntax struct ()
We can't keep `syntect::parsing::SyntaxReference` as part of the public
API, because that might prevent us from bumping to syntect 6.0.0 without
also bumping bat to v2.0.0, once we reach v1.0.0.

So introduce a new stripped down struct `Syntax` and return that
instead. Let it be fully owned to make the API simple. It is not going
to be in a hot code path anyway.

I have looked at all code of our 27 dependents but I can't find a single
instance of this method being used, so this change should be safe for
v1.0.0.
2022-09-03 12:33:38 +02:00
8b8ff96c32 CHANGELOG: Mention minor LiveScript update 2022-09-03 07:58:22 +02:00
3d35469414 Bump assets/syntaxes/02_Extra/LiveScript from 2575013 to d82aeb7 ()
Bumps [assets/syntaxes/02_Extra/LiveScript](https://github.com/paulmillr/LiveScript.tmbundle) from `2575013` to `d82aeb7`.
- [Release notes](https://github.com/paulmillr/LiveScript.tmbundle/releases)
- [Commits](2575013851...d82aeb737d)

---
updated-dependencies:
- dependency-name: assets/syntaxes/02_Extra/LiveScript
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-03 07:43:07 +02:00
3480b61eae Bump wild from 2.0.4 to 2.1.0 ()
Bumps [wild](https://gitlab.com/kornelski/wild) from 2.0.4 to 2.1.0.
- [Release notes](https://gitlab.com/kornelski/wild/tags)
- [Commits](https://gitlab.com/kornelski/wild/commits/v2.1.0)

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

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-02 19:49:35 +02:00
0167ba55dd Bump thiserror from 1.0.31 to 1.0.33 ()
Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.31 to 1.0.33.
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](https://github.com/dtolnay/thiserror/compare/1.0.31...1.0.33)

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

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-02 19:36:49 +02:00
06dcead2d5 Bump serde from 1.0.143 to 1.0.144 ()
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.143 to 1.0.144.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.143...v1.0.144)

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

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-02 19:36:35 +02:00
cc7df1e92b Bump once_cell from 1.13.0 to 1.13.1 ()
Bumps [once_cell](https://github.com/matklad/once_cell) from 1.13.0 to 1.13.1.
- [Release notes](https://github.com/matklad/once_cell/releases)
- [Changelog](https://github.com/matklad/once_cell/blob/master/CHANGELOG.md)
- [Commits](https://github.com/matklad/once_cell/compare/v1.13.0...v1.13.1)

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

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-02 19:36:21 +02:00
899fdbb347 Remove code that tries to handle ANSI escape inputs ()
Syntax highlighting is broken when input contains ANSI escape characters
anyway, so there is not much point in trying to handle ANSI escapes in
input.
2022-08-29 18:49:29 +02:00
a6297b282c update CHANGELOG 2022-08-27 16:37:34 +02:00
33ba136fa3 fix --pager opts display and add some examples 2022-08-27 16:37:34 +02:00