* 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
* git global config - lookup $XDG_CONFIG_HOME faithfully
* Use `bool::then`
* Cover both `$XDG_CONFIG_HOME` & `$HOME/.config`
* Remove unused import
* Global git config tests
* Added trailing newline
* Fix git config test
* Wrote to changelog
* Revert change of `Result::ok` to `Result::unwrap`
* Apply suggestions from code review
Co-authored-by: Martin Nordholts <enselic@gmail.com>
* Guard against empty `$HOME`
Co-authored-by: Martin Nordholts <enselic@gmail.com>
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.
We want to make sure that all of our test environments are clean from
possible outside modification. This consolidates the list of used
environment variables in Rust-based and Python-based integration tests.
Note that there is also a similar list in `src/bin/bat/main.rs` which
is even more exhaustive (for bug report collection). However, some
of these variables can not possibly have an effect on test environments.
Do not ignore `BAT_CONFIG_PATH` if it doesn't exist. Both when
generating a new config file with `--generate-config-file` and
when attempting to read the config.
Also, provide a better error message in case the file can not
be created.
closes#1550
Fixed by implementing the proposal by sharkdp:
* Allow PAGER=bat, but ignore the setting in bat and simply default to
less. Unless of course, BAT_PAGER or --pager is used to overwrite the
value of PAGER.
* Disallow the usage of bat within BAT_PAGER and --pager.
Right now all tests pass even if we e.g. return
Ok(OutputType::stdout())
instead of doing
.chain_err(|| "Could not parse pager command.")?
so add a test to make sure this functionality don't break.
This is a regression test for the fix for issue #299. If that fix is
reverted, currently only one test ('header_padding') fails. But that
test is for a different use case, so add a dedicated regression test for
the particular use case issue #299 is about.
As mentioned on #1334 `bat` should not be used as a value for `pager`,
this change checks both the balue of `bat` provided as a parameter or
as an environment variable.