neekey / table-parser

A parser to parse table style output from shell
MIT License
25 stars 13 forks source link

Fix repeated headers to be bounded properly #12

Closed Empact closed 6 years ago

Empact commented 6 years ago

Previously, the field lookup occurred from the beginning of the line so would repeated find the same line location if the same string or a substring of a header was searched more than once.

Instead track the current end index of the previous field to base the search state location on.

neekey commented 6 years ago

Looks good! Thanks

Empact commented 6 years ago

@neekey once you make a release, I'll update neekey/ps#69 to reference it