You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: Make skip_lines option allow skipping at end (#122)
This adds feature discussed in #80
skip_lines now interprets negative values as lines to skip at the end of
a sorted region.
skip_lines now accepts up to two values. If two values are specified,
the first must be lines skipped at the start and the second lines
skipped at the end. Internally this is represented as an int slice.
Add ability for parse options to handle int slices.
Modify golden examples to maintain intended behavior.
Update documentation with example of skipping lines both at the start
and end.
---------
Co-authored-by: Jeffrey Faer <jeffrey.faer@gmail.com>
// Both are the same sign. It's okay for both to be 0.
343
+
ifopts.SkipLines[0] <0 {
344
+
// Both are negative.
345
+
warns=append(warns, fmt.Errorf("skip_lines has conflicting values (should one of these be positive, to skip lines at the start of the block instead?): %v", formatIntList(opts.SkipLines)))
346
+
opts.SkipLines=nil
347
+
} elseifopts.SkipLines[0] >0 {
348
+
// Both are positive.
349
+
warns=append(warns, fmt.Errorf("skip_lines has conflicting values (should one of these be negative, to skip lines at the end of the block instead?): %v", formatIntList(opts.SkipLines)))
0 commit comments