X-Git-Url: https://iankelling.org/git/?p=cedit;a=blobdiff_plain;f=cedit;h=9d37b55e56bc1053527489f86c8c4673420361ca;hp=e6d128d291ad58af7c630dd5f52e151586937859;hb=a612c049422536786fde20b55470e933f0b521ae;hpb=9ee05f569ce5da96047000722dbde36f689d826d 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 "$@"