diff options
author | Dubiousjim <dubiousjim@gmail.com> | 2013-07-01 17:14:17 -0400 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2013-07-03 07:56:16 +0000 |
commit | 27770e1e07da16dcd911a638434fd3dda3137db2 (patch) | |
tree | 6919ec96858886f0592334381cae72be532c6813 | |
parent | 63198c22087474306f38e7158b701f673da6ea8e (diff) | |
download | alpine-conf-27770e1e07da16dcd911a638434fd3dda3137db2.zip |
update-conf: add vimdiff action
-rw-r--r-- | update-conf.in | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/update-conf.in b/update-conf.in index c3ba366..18e4e7d 100644 --- a/update-conf.in +++ b/update-conf.in @@ -51,6 +51,11 @@ while true; do shift done +if which vimdiff >/dev/null; then + vflag=", Vimdiff old new" + vflag2="/v" +fi + for apknew in $(find "$ROOT/etc" -name '*.apk-new') ; do p="${apknew%.apk-new}" f="${p#${ROOT}/}" @@ -75,7 +80,7 @@ for apknew in $(find "$ROOT/etc" -name '*.apk-new') ; do # ask user what to do with the file while [ -z "$choice" ] ; do echo "New $p available:" - echon "Quit, Next, Show diff, Edit new, Zap new, Use new (q/n/s/e/z/u) [s]: " + echon "Quit, Next, Show diff, Edit new${vflag}, Zap new, Use new (q/n/s/e${vflag2}/z/u) [s]: " default_read choice "s" </dev/tty case "$choice" in q) exit;; @@ -84,6 +89,10 @@ for apknew in $(find "$ROOT/etc" -name '*.apk-new') ; do unset choice ;; e) ${EDITOR:-vi} "$apknew" ; unset choice;; + v) if [ "$vflag" ]; then + vimdiff "$p" "$apknew" + fi + unset choice;; z) rm "$apknew";; u) mv "$apknew" "$p";; *) unset choice;; |