Package: diffutils
Version: 1:3.10-1build1
Severity: wishlist

This form allows me to use a program to compare 2 files and use sdiff to format the results:

sdiff --diff-program=PROGRAM ...

What I *really* want to do is define my own line-wise comparison, though, so "sdiff" will show lines as matching if the approximately match in a way I specify. Allowing me to pass positional arguments to the comparator would give me flexibility without having to write a unique comparator program for each case.
Here are two examples:

sdiff --comparator-program=prefix --comparator-arg="5" ...
sdiff --comparator-program=field --comparator-arg='\d+ (\d+) .*' --comparator-arg='\d+ \d+ (\d+) .*' ...

The first case would match the first 5 characters of each line. The second case would match numbers in the second column of the first line with the third column of the second line. Note that "sdiff" doesn't have to process these arguments, it just passes them verbatim as positional-parameters to the comparator program, along with the 2 lines being compared. The comparator programs would just be executables, written any way that's convenient.




Reply via email to