pff: cosmetic

This commit is contained in:
Jephté Clain 2018-02-07 16:58:54 +04:00
parent 9eaed33548
commit 86963ec09f
1 changed files with 13 additions and 1 deletions

14
pff
View File

@ -998,7 +998,7 @@ function edit_cmd() {
function diff_cmd() {
local list_names="$1"; shift
local pffdir profile srcp destp
local pffdir profile srcp destp desc
case $# in
0)
ensure_pffdir pffdir
@ -1033,6 +1033,16 @@ function diff_cmd() {
destp="$2"
;;
esac
[ "$destp" == "Common|Base" ] && destp=
if [ -z "$destp" ]; then
if [ "$srcp" == Base -o "$srcp" == Common ]; then
desc="pff --diff $srcp Base"
else
desc="pff --diff $srcp ${destp:-"Common|Base"}"
fi
else
desc="pff --diff $srcp $destp"
fi
local -a lfiles; local rfile bfile Cfile srcfile destfile
setx -a lfiles=get_local_files "$pffdir"
@ -1058,6 +1068,8 @@ function diff_cmd() {
if [ -n "$list_names" ]; then
diff -q "$srcfile" "$destfile" >&/dev/null || echo "$srcfile"
else
[ -n "$desc" ] && echo "$desc"
desc=
diff -ur "$srcfile" "$destfile"
fi
done | page_maybe