From 41a6fe09c598a9cc642b200f98a4720a783dfce8 Mon Sep 17 00:00:00 2001 From: Valentin Rothberg Date: Thu, 2 Dec 2021 19:58:58 +0100 Subject: [PATCH] fix `all` selector Fixes: #165 Signed-off-by: Valentin Rothberg --- test/show.bats | 2 ++ vgrep.go | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/test/show.bats b/test/show.bats index f4b2814..d787127 100644 --- a/test/show.bats +++ b/test/show.bats @@ -49,6 +49,8 @@ load helpers [ "$status" -eq 0 ] run_vgrep -s d0,1-10,21,22,50 [ "$status" -eq 0 ] + run_vgrep -s dall + [ "$status" -eq 0 ] } @test "Show ?" { diff --git a/vgrep.go b/vgrep.go index f9811cd..ddb187d 100644 --- a/vgrep.go +++ b/vgrep.go @@ -711,7 +711,7 @@ func (v *vgrep) dispatchCommand(input string) bool { } // normalize selector-only inputs (e.g., "1,2,3,5-10") to the show cmd - selectorRegexp := `( +all|[\d , -]+){0,1}` + selectorRegexp := `(\s*all|[\d , -]+){0,1}` numRgx := regexp.MustCompile(`^` + selectorRegexp + `$`) if numRgx.MatchString(input) { input = "s " + input