Skip to content

Commit

Permalink
if no lines are specified, show whole log
Browse files Browse the repository at this point in the history
  • Loading branch information
hanneshayashi committed Dec 20, 2020
1 parent 038d74c commit d89b67f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gsmlog/general.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func PrintLastLines(path string, n int) error {
s := string(b)
lines := strings.Split(s, "\n")
max := len(lines) - 1
if n > max {
if n > max || n == 0 {
n = max
}
for _, l := range lines[max-n : max] {
Expand Down

0 comments on commit d89b67f

Please sign in to comment.