section. cedit is short for config edit.
-q Quiet
+-s Silent. Quiet and exit 0 on modified file.
-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
- local quiet=false
+ local s diff name init file_dir exists verbose backup quiet silent
+ file_dir="$(dirname "$file")"
+ exists=true
+ verbose=false
+ backup=false
+ quiet=false
+ silent=false
case $1 in
-b) backup=true; shift ;;
-v) verbose=true; shift ;;
-q) quiet=true; shift ;;
+ -s) quiet=true; silent=true; shift ;;
-h|--help) echo "$help"; return ;;
esac
if ! $backup && $exists; then
rm -r "$temp"
fi
- return $ret
+ if $silent; then
+ case $ret in
+ 0|1) return 0 ;;
+ *) return $ret ;;
+ esac
+ else
+ return $ret
+ fi
}
cedit "$@"