Quiero usar la herramienta cli para la comparación de archivos y necesito un número de línea antes de la línea de salida con la que podría saltar a la diferencia de línea, porque uso la herramienta que entiende dónde saltar, si la línea comienza así :line-number: regular line contents
Así que lo intenté diff, y leer la documentación parece que podría ser posible:
-D, --ifdef=NAME output merged file with `#ifdef NAME' diffs
--GTYPE-group-format=GFMT format GTYPE input groups with GFMT
--line-format=LFMT format all input lines with LFMT
--LTYPE-line-format=LFMT format LTYPE input lines with LFMT
These format options provide fine-grained control over the output
of diff, generalizing -D/--ifdef.
LTYPE is `old', `new', or `unchanged'. GTYPE is LTYPE or `changed'.
GFMT (only) may contain:
%< lines from FILE1
%> lines from FILE2
%= lines common to FILE1 and FILE2
%[-][WIDTH][.[PREC]]{doxX}LETTER printf-style spec for LETTER
LETTERs are as follows for new group, lower case for old group:
F first line number
L last line number
N number of lines = L-F+1
E F-1
M L+1
%(A=B?T:E) if A equals B then T else E
LFMT (only) may contain:
%L contents of line
%l contents of line, excluding any trailing newline
%[-][WIDTH][.[PREC]]{doxX}n printf-style spec for input line number
Both GFMT and LFMT may contain:
%% %
%c'C' the single character C
%c'\OOO' the character with octal code OOO
C the character C (other characters represent themselves)
pero no hay ningún ejemplo o explicación sobre este complicado cambio.
¿Es posible obtener ese resultado diff? ¿Si es así, cómo?

difflibmódulo con archivos indexados por línea en el objeto de lista) solo que no pude usardiff <(pipe buffer1) <(pipe buffer2)con Python, como lo planeédiff. Ahora me salvaste :)