mirror of
https://github.com/sharkdp/bat.git
synced 2025-04-18 16:50:33 +01:00
Make --no-paging and --no-pager work again
This commit is contained in:
parent
cb4973987b
commit
89217e0d58
@ -294,6 +294,7 @@ pub fn build_app(interactive_output: bool) -> ClapApp<'static, 'static> {
|
|||||||
.arg(
|
.arg(
|
||||||
Arg::with_name("no-paging")
|
Arg::with_name("no-paging")
|
||||||
.short("P")
|
.short("P")
|
||||||
|
.long("no-paging")
|
||||||
.alias("no-pager")
|
.alias("no-pager")
|
||||||
.overrides_with("no-paging")
|
.overrides_with("no-paging")
|
||||||
.hidden(true)
|
.hidden(true)
|
||||||
|
@ -1122,6 +1122,42 @@ fn show_all_mode() {
|
|||||||
.stderr("");
|
.stderr("");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn no_paging_arg() {
|
||||||
|
bat()
|
||||||
|
.arg("--no-paging")
|
||||||
|
.arg("--color=never")
|
||||||
|
.arg("--decorations=never")
|
||||||
|
.arg("single-line.txt")
|
||||||
|
.assert()
|
||||||
|
.success()
|
||||||
|
.stdout("Single Line");
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn no_paging_short_arg() {
|
||||||
|
bat()
|
||||||
|
.arg("-P")
|
||||||
|
.arg("--color=never")
|
||||||
|
.arg("--decorations=never")
|
||||||
|
.arg("single-line.txt")
|
||||||
|
.assert()
|
||||||
|
.success()
|
||||||
|
.stdout("Single Line");
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn no_pager_arg() {
|
||||||
|
bat()
|
||||||
|
.arg("--no-pager")
|
||||||
|
.arg("--color=never")
|
||||||
|
.arg("--decorations=never")
|
||||||
|
.arg("single-line.txt")
|
||||||
|
.assert()
|
||||||
|
.success()
|
||||||
|
.stdout("Single Line");
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn plain_mode_does_not_add_nonexisting_newline() {
|
fn plain_mode_does_not_add_nonexisting_newline() {
|
||||||
bat()
|
bat()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user