diffpkg: pass the --color option appropriately to diffoscope
Diffoscope has a different option, called --text-color which only understands the verbose options. Hence we extend the --color shorthand for --color=auto and pass the changed option name to diffoscope.
This commit is contained in:
parent
2e4060445a
commit
f8d2ad9a7d
|
@ -54,7 +54,7 @@ PKGINFO=0
|
||||||
BUILDINFO=0
|
BUILDINFO=0
|
||||||
|
|
||||||
DIFFMODE=--side-by-side
|
DIFFMODE=--side-by-side
|
||||||
DIFFCOLOR=--color
|
DIFFCOLOR=--color=auto
|
||||||
DIFFWIDTH=--width=auto
|
DIFFWIDTH=--width=auto
|
||||||
DIFFOPTIONS=(--expand-tabs)
|
DIFFOPTIONS=(--expand-tabs)
|
||||||
|
|
||||||
|
@ -104,7 +104,11 @@ while (( $# )); do
|
||||||
shift 2
|
shift 2
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
DIFFCOLOR="$1"
|
if [[ $1 == --color ]]; then
|
||||||
|
DIFFCOLOR="--color=auto"
|
||||||
|
else
|
||||||
|
DIFFCOLOR="$1"
|
||||||
|
fi
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
-W|--width)
|
-W|--width)
|
||||||
|
@ -242,7 +246,7 @@ diff_pkgs() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if (( DIFFOSCOPE )); then
|
if (( DIFFOSCOPE )); then
|
||||||
diffoscope "$oldpkg" "$newpkg"
|
diffoscope "${DIFFCOLOR/--color/--text-color}" "$oldpkg" "$newpkg"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue