Skip to content

Commit

Permalink
fix all selector
Browse files Browse the repository at this point in the history
Fixes: #165
Signed-off-by: Valentin Rothberg <[email protected]>
  • Loading branch information
vrothberg committed Mar 31, 2022
1 parent 85d006c commit 41a6fe0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions test/show.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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 ?" {
Expand Down
2 changes: 1 addition & 1 deletion vgrep.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 41a6fe0

Please sign in to comment.