iankelling.org
/
git
/
cedit
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
380c58f
)
add quiet flag
author
Ian Kelling
<iank@fsf.org>
Wed, 15 Dec 2021 19:33:22 +0000
(14:33 -0500)
committer
Ian Kelling
<iank@fsf.org>
Wed, 15 Dec 2021 19:33:22 +0000
(14:33 -0500)
cedit
patch
|
blob
|
history
diff --git
a/cedit
b/cedit
index 9b21969b4ce204a518fd125f961af14a5c5881fb..62331b48c85808fefb44d1866cfec7218484784c 100755
(executable)
--- a/
cedit
+++ b/
cedit
@@
-24,6
+24,7
@@
The section is #comment delimited. Reads STDIN for the contents of the
section. Without SECTION_NAME, it acts on a global unnamed
section. cedit is short for config edit.
section. Without SECTION_NAME, it acts on a global unnamed
section. cedit is short for config edit.
+-q Quiet
-v Verbose
-b Keep backup file
-h|--help Help"
-v Verbose
-b Keep backup file
-h|--help Help"
@@
-32,10
+33,12
@@
section. cedit is short for config edit.
local exists=true
local verbose=false
local backup=false
local exists=true
local verbose=false
local backup=false
+ local quiet=false
case $1 in
-b) backup=true; shift ;;
-v) verbose=true; shift ;;
case $1 in
-b) backup=true; shift ;;
-v) verbose=true; shift ;;
+ -q) quiet=true; shift ;;
-h|--help) echo "$help"; return ;;
esac
-h|--help) echo "$help"; return ;;
esac
@@
-115,7
+118,7
@@
section. cedit is short for config edit.
elif type -t diff &>/dev/null; then
diff=$(diff -u "$temp" "$file")
ret=$?
elif type -t diff &>/dev/null; then
diff=$(diff -u "$temp" "$file")
ret=$?
- if (( $ret )); then
+ if (( $ret ))
&& ! $quiet
; then
echo "backup of original at $temp"
echo diff -u "$temp" "$file":
echo "$diff"
echo "backup of original at $temp"
echo diff -u "$temp" "$file":
echo "$diff"