mirror of
https://github.com/sharkdp/bat.git
synced 2025-01-31 02:01:05 +00: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::with_name("no-paging")
|
||||
.short("P")
|
||||
.long("no-paging")
|
||||
.alias("no-pager")
|
||||
.overrides_with("no-paging")
|
||||
.hidden(true)
|
||||
|
@ -1122,6 +1122,42 @@ fn show_all_mode() {
|
||||
.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]
|
||||
fn plain_mode_does_not_add_nonexisting_newline() {
|
||||
bat()
|
||||
|
Loading…
x
Reference in New Issue
Block a user