Commit Graph

56 Commits

Author SHA1 Message Date
David Peter a65b0828ee Merge remote-tracking branch 'origin/master' into HEAD 2022-10-30 20:43:06 +01:00
David Peter ccde13c9e8 Hide 'cache' subcommand, re-enable bold/underline styling, add note about cache subcommand 2022-10-30 20:26:06 +01:00
John Higgins ff71303349
Update src/bin/bat/clap_app.rs for PR 2309
Co-authored-by: Martin Nordholts <enselic@gmail.com>
2022-10-17 23:35:52 -07:00
John Higgins 236a2c5794
Fixed inverted logic on -S and --chop-long-lines 2022-10-13 23:52:15 -07:00
Gábor Lipták 1e0b0f7c5c Add github-actions to Dependabot
Signed-off-by: Gábor Lipták <gliptak@gmail.com>
2022-10-03 15:18:39 -05:00
John Higgins a272d3df16
Added -S flag for truncating long lines 2022-09-09 17:04:09 -07:00
Ed Page 08c91a116c refactor: Parse, don't validate 2022-09-03 14:01:56 +02:00
Ed Page 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
Ed Page 50bb924ee3 refactor: Replace multiple_occurrences 2022-09-03 14:01:56 +02:00
Ed Page e8e1c1d6c9 refactor: Replace allow_invalid_utf8 with PathBuf 2022-09-03 14:01:56 +02:00
Ed Page 542b3d2317 refactor: Resolve basic clap deprecations 2022-09-03 14:01:56 +02:00
Ed Page 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
Marie Katrine Ekeberg 9c7ca33929
Make `--no-paging`/`-P` override `--paging=...` if passed as a later arg (#2201)
* Make the no-paging option override earlier paging options

* Update CHANGELOG.md

Co-authored-by: Martin Nordholts <enselic@gmail.com>
2022-08-14 21:09:13 +02:00
Anders Kaseorg 4583826a5b Fix documentation typo: --pager=never → --paging=never
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2022-07-07 06:09:11 +02:00
Isaac Horvath adea895026
Add a --style=default option (#2119)
* Add a --style=default option

* Added --style=default test and CHANGELOG entry

* Format CHANGELOG.md options with quotes

Co-authored-by: Martin Nordholts <enselic@gmail.com>

* Update help text for '--style'

* Make --style=default the default option

* Update style descriptions: "basic" -> "recommended"

* Add integration test for --style=default as default

* Update clap long help for --style
2022-05-04 21:31:32 +02:00
Mahdi Dibaiee 312c8ef01f
Add new `--style` called `header-filesize` and display it by default (#1988)
Also rename `header` to `header-filename`.

Related to #1701
2022-02-07 20:48:57 +01:00
Martin Nordholts 5b37438f08 `bat --help`: Put `--ignored-suffix` directly after `--map-syntax`
It feels out of place to have between `--acknowledgements` and `--help`.
2022-01-08 17:01:20 +01:00
Martin Nordholts a3ea798246
Credit syntax definition and theme authors with new `--acknowledgements` option (#1971)
The text that is printed is generated when building assets, by analyzing LICENSE
and NOTICE files that comes with syntaxes and themes.

We take this opportunity to also add a NOTICE file as defined by Apache License 2.0.
2021-12-11 14:00:45 +01:00
Martin Nordholts 5519f9c716 Use once_cell instead of lazy_static
once_cell can do what lazy_static does and more, so replace lazy_static with
once_cell.

See https://docs.rs/once_cell/1.8.0/once_cell/#general-purpose-lazy-evaluation
2021-11-22 22:03:03 +01:00
Bojan Đurđević d6ed5e6746
Support for ignored-suffix CLI arguments (#1892) 2021-11-19 17:05:23 +01:00
Martin Nordholts 4081ace4b9 Include git hash in `bat -V` and `bat --version` output if present
I had to use a `lazy_static` due to that the clap API that only accepts a
reference to a version string. And, in our code, only a 'static reference to a
version string.

Code could probably be refactored to accept a "normal" reference, but that would
be a major undertaking.
2021-10-24 11:36:55 +02:00
Bojan Durdevic 0748783404 Support for line range plus syntax 2021-08-23 19:55:41 +02:00
Martin Nordholts 89217e0d58 Make --no-paging and --no-pager work again 2021-08-09 13:37:56 +02:00
Martin Nordholts 8ecd23eab4 Make --style docs reflect that 'full' is default
Closes #1742
2021-08-07 09:51:36 +02:00
Martin Nordholts b040efff79 Support a hidden arg --no-custom-assets that skips loading assets from the cache 2021-07-29 08:27:02 +02:00
sharkdp 1ae16fca90 Improve --map-syntax documentation, see #1386 2021-01-10 22:24:32 +01:00
sharkdp 26136be903 Add --diagnostics alias 2021-01-06 22:53:51 +01:00
sharkdp ebb97e94a9 Add --diagnostic option to bat 2021-01-06 22:53:51 +01:00
Tom Milligan aa4000cb0d
style: add component 'rule' for horizontal file delimiter 2020-10-12 09:04:27 +01:00
henil 8ff890635f add an after help NOTE 2020-10-04 06:33:11 +02:00
sharkdp 32d22f464d Improve --style help text, closes #1146 2020-09-20 21:00:04 +02:00
sharkdp 71b2089384 Code formatting 2020-09-20 20:47:21 +02:00
sharkdp 57aa88a13a Improve --file-name help text, closes #1109 2020-09-20 20:43:30 +02:00
Alexander Karlis d349974089 updated PR based on comments 2020-09-14 11:24:14 +02:00
Alexander Karlis fdf11326ef added additional alias for color=always when always-decorations flag is triggered 2020-09-14 11:24:14 +02:00
Alexander Karlis 565a80305c Added new alias for 'decoration=always' 2020-09-14 11:24:14 +02:00
sharkdp 2b3457e8d6 Update --help text for --color 2020-07-25 22:32:34 +02:00
Dash Peters c264f74771 Hide alias in help, update man and completions
A long alias doesn't make sense, since `--paging=never` already exists
2020-07-02 00:07:37 -07:00
Dash Peters 5fdeeabb44 Change to name no-paging, add long flag and alias 2020-07-01 21:35:45 -07:00
Dash Peters 2575aae945 Add short flag for --paging=never 2020-06-30 12:19:22 -07:00
Ethan P 8b481dd41f Add support for NO_COLOR env var (#1021) 2020-05-28 21:49:10 +02:00
Ethan P 887e61a99d
Allow application to be built without git support
Caveats:
The help descriptions aren't changed with you remove the "git" feature.
2020-05-15 13:58:48 -07:00
sharkdp 989109145a Add '-d' for '--diff' 2020-04-24 16:12:38 +02:00
Lzu Tao e37e9c1214 Fix some clippy lints
Some might actually improve perf
2020-04-24 16:11:05 +02:00
sharkdp 82e7786e74 Implementation of 'bat --diff'
This adds a new `--diff` option that can be used to only show lines
close to Git changes (added/removed/modified lines). The amount of
additional context can be controlled with `--diff-context=N`.

closes #23
2020-04-24 09:57:57 +02:00
David Tolnay 570805bc98 Strip dependencies of bat-as-a-library 2020-03-31 09:27:56 +02:00
David Peter 37b3b8730d
Merge pull request #871 from neuronull/fix_654_stdin_filename
Implement --file-name<name> option
2020-03-26 09:35:01 +01:00
Josh Mickley 376c556862 Add option to generate a default config file, fixes #870 2020-03-26 09:14:40 +01:00
Kyle Criddle 38178fedf4 Merge branch 'master' into fix_654_stdin_filename 2020-03-24 19:08:43 -06:00
sharkdp 978def2d40 Update documentation 2020-03-22 11:02:51 +01:00