From: Ian Kelling Date: Fri, 28 Oct 2016 06:13:15 +0000 (-0700) Subject: dont keep backups by default X-Git-Url: https://iankelling.org/git/?a=commitdiff_plain;h=a612c049422536786fde20b55470e933f0b521ae;p=cedit dont keep backups by default --- diff --git a/cedit b/cedit index e6d128d..9d37b55 100755 --- a/cedit +++ b/cedit @@ -25,13 +25,16 @@ section. Without SECTION_NAME, it acts on a global unnamed section. cedit is short for config edit. -v Verbose +-b Keep backup file -h|--help Help" local s diff name init local file_dir="$(dirname "$file")" local exists=true local verbose=false + local backup=false case $1 in + -b) backup=true; shift ;; -v) verbose=true; shift ;; -h|--help) echo "$help"; return ;; esac @@ -116,6 +119,9 @@ section. cedit is short for config edit. echo "$diff" fi fi + if ! $backup; then + rm -r $"$temp" + fi return $ret } cedit "$@"