cedit() {
local help="Usage: [-h|--help ] [-v] [SECTION_NAME] FILE
-Create/edit a #comment delimited section of a file
+Create/modify a section in a config file
-Reads STDIN for the contents of the section. Without SECTION_NAME, it
-acts on a global unnamed section. cedit is short for config edit.
+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.
-v Verbose
-h|--help Help"
local verbose=false
case $1 in
+ -v) verbose=true; shift ;;
-h|--help) echo "$help"; return ;;
esac
- if [[ $1 == -v ]]; then
- verbose=true
- shift
- fi
if (( $# == 2 )); then
name=": $1"
shift
fi
else
diff=$(cmp "$temp" "$file")
- ret=$?
if $verbose; then
echo "$diff"
fi
fi
- return $ret
+ return 0
}
cedit "$@"