From 86963ec09fce0d440fc0d82317a7fc232af0fa90 Mon Sep 17 00:00:00 2001 From: Jephte Clain Date: Wed, 7 Feb 2018 16:58:54 +0400 Subject: [PATCH] pff: cosmetic --- pff | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/pff b/pff index 62e2940..862683b 100755 --- a/pff +++ b/pff @@ -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