Bash scripts that integrate bat with various command line tools.
Go to file
Harrison McCullough 67f1ff9c0e Add support for fixed strings and --less-search-pattern
Previously, if you tried to use the `-F`/`--fixed strings` option for ripgrep in
combination with the `--less-search-pattern` option, `less` would either a)
match a different pattern than intended, since it would be interpreted as a
regular expression, or b) refuse to start if it detected an invalid pattern.

This change keeps track of whether or not the `--fixed-strings` option was
passed in. If both it and the `--less-search-pattern` was passed in, a `^R`
(Control-R) control character is prepended to the search pattern. This instructs
less to *not* treat the pattern as a regular expression.
2020-01-17 11:05:06 -05:00
.circleci Update CI environment to have script command 2019-12-23 17:49:34 -08:00
doc Update batgrep documentation 2019-12-23 16:50:56 -08:00
lib Fix inline docs for version.sh lib 2019-09-26 15:37:11 -07:00
src Add support for fixed strings and --less-search-pattern 2020-01-17 11:05:06 -05:00
test Fix inconsistencies in tests between tty and script 2019-12-25 00:17:01 -08:00
.gitignore Fixed CI tests, hopefully. 2019-06-19 17:37:16 -07:00
build.sh Update build.sh to fix output messages 2019-10-27 00:14:55 -07:00
LICENSE.md Added license. 2019-06-19 14:41:20 -07:00
README.md Add build status to README 2019-09-26 16:00:02 -07:00

bat-extras

Bash scripts that integrate bat with various command line tools.

 

Scripts

 

Installation (CircleCI)

The scripts in this repository are designed to run as-is, provided that they aren't moved around. This means that you're free to just symlink src/[script].sh to your local bin folder.

If you would rather have self-contained scripts that you can place and run anywhere, you can use the build.sh script to create (and optionally install) them.

 

Building:

./build.sh [OPTIONS...]

This will combine and preprocess each script under the src directory, and create corresponding self-contained scripts in the bin folder. Any library scripts that are sourced using source "${LIB}/[NAME].sh" will be embedded automatically.

 

Minification:

There are three different options for minification:

Option Description
--minify=none Nothing will be minified.
--minify=lib Embedded library scripts will be minified. [default]
--minify=all Everything will be minified.

This uses shfmt to perform minification.

 

Installation:

You can also specify --install and --prefix=PATH to have the build script automatically install the scripts for all users on the system. You may need to run the build script as root.

If you only want to install a single script, you can run the build process and copy the script directly out of the newly-created bin folder.

Alternate Executable:

Depending on the distribution, bat may have been renamed to avoid package conflicts. If you wish to use these scripts on a distribution where this is the case, there is an --alternate-executable=NAME option which will build the scripts to use an alternate executable name.

Verification:

The build script will attempt to verify the correctness of the "bin" scripts by comparing their output with their source counterparts. It is recommended to let it do this, but you can disable verification with the --no-verify option.