mirror of
https://github.com/sharkdp/bat.git
synced 2025-02-20 11:58:45 +00:00
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>
This commit is contained in:
parent
02a9d191ed
commit
9c7ca33929
@ -7,6 +7,7 @@
|
||||
## Bugfixes
|
||||
|
||||
- Prevent fork nightmare with `PAGER=batcat`. See #2235 (@johnmatthiggins)
|
||||
- Make `--no-paging`/`-P` override `--paging=...` if passed as a later arg, see #2201 (@themkat)
|
||||
|
||||
## Other
|
||||
|
||||
|
@ -293,6 +293,7 @@ pub fn build_app(interactive_output: bool) -> ClapApp<'static, 'static> {
|
||||
Arg::with_name("paging")
|
||||
.long("paging")
|
||||
.overrides_with("paging")
|
||||
.overrides_with("no-paging")
|
||||
.takes_value(true)
|
||||
.value_name("when")
|
||||
.possible_values(&["auto", "never", "always"])
|
||||
|
@ -695,6 +695,18 @@ fn alias_pager_disable_long_overrides_short() {
|
||||
.stdout(predicate::eq("pager-output\n").normalize());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn disable_pager_if_disable_paging_flag_comes_after_paging() {
|
||||
bat()
|
||||
.env("PAGER", "echo pager-output")
|
||||
.arg("--paging=always")
|
||||
.arg("-P")
|
||||
.arg("test.txt")
|
||||
.assert()
|
||||
.success()
|
||||
.stdout(predicate::eq("hello world\n").normalize());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn pager_failed_to_parse() {
|
||||
bat()
|
||||
|
Loading…
x
Reference in New Issue
Block a user