1
0
mirror of https://github.com/sharkdp/bat.git synced 2025-10-23 04:03:59 +01:00

fix: allow hyphen values to -r/--line-range

via #2944
This commit is contained in:
Louis Maddox
2025-10-19 19:23:57 +01:00
committed by Louis Maddox
parent 20db989fb1
commit 52a792d46f
4 changed files with 17 additions and 1 deletions

View File

@@ -207,7 +207,7 @@ fn line_range_from_back_last_two() {
}
#[test]
fn line_range_from_back_last_two_single_line() {
fn line_range_from_back_last_two_single_line_eq_sep() {
bat()
.arg("single-line.txt")
.arg("--line-range=-2:")
@@ -216,6 +216,17 @@ fn line_range_from_back_last_two_single_line() {
.stdout("Single Line");
}
#[test]
fn line_range_from_back_last_two_single_line_no_sep() {
bat()
.arg("single-line.txt")
.arg("--line-range")
.arg("-2:")
.assert()
.success()
.stdout("Single Line");
}
#[test]
fn line_range_first_two() {
bat()