-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Make -pp override --paging and vice versa when passed as a later argument. #2660
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
a747b37
9837046
1871aea
a0efda4
79734bf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -873,6 +873,42 @@ fn disable_pager_if_disable_paging_flag_comes_after_paging() { | |
| .stdout(predicate::eq("hello world\n").normalize()); | ||
| } | ||
|
|
||
| #[test] | ||
| fn disable_pager_if_pp_flag_comes_after_paging() { | ||
| bat() | ||
| .env("PAGER", "echo pager-output") | ||
| .arg("--paging=always") | ||
| .arg("-pp") | ||
| .arg("test.txt") | ||
| .assert() | ||
| .success() | ||
| .stdout(predicate::eq("hello world\n").normalize()); | ||
| } | ||
|
|
||
| #[test] | ||
| fn enable_pager_if_disable_paging_flag_comes_before_paging() { | ||
| bat() | ||
| .env("PAGER", "echo pager-output") | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you for the rebase @J-Kappes . @boyvanduuren I don't understand how this new test can pass on Windows. It is rebased on your work, so shouldn't this need There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Seems so indeed. Running the tests locally on Windows/PS cause them to fail. I'll create a bug for this and take another look. |
||
| .arg("-P") | ||
| .arg("--paging=always") | ||
| .arg("test.txt") | ||
| .assert() | ||
| .success() | ||
| .stdout(predicate::eq("pager-output\n").normalize()); | ||
| } | ||
|
|
||
| #[test] | ||
| fn enable_pager_if_pp_flag_comes_before_paging() { | ||
| bat() | ||
| .env("PAGER", "echo pager-output") | ||
| .arg("-pp") | ||
| .arg("--paging=always") | ||
| .arg("test.txt") | ||
| .assert() | ||
| .success() | ||
| .stdout(predicate::eq("pager-output\n").normalize()); | ||
| } | ||
|
|
||
| #[test] | ||
| fn pager_failed_to_parse() { | ||
| bat() | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.