return 0 even if we made changes
[cedit] / cedit
diff --git a/cedit b/cedit
index d04f587b62928d5ab9744bdccac5e890eb07b895..629fe01b1e01db5baabbed83a317206dca5ef2bb 100755 (executable)
--- a/cedit
+++ b/cedit
 
 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"
@@ -28,13 +29,10 @@ acts on a global unnamed section. cedit is short for config edit.
     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
@@ -110,11 +108,10 @@ acts on a global unnamed section. cedit is short for config edit.
         fi
     else
         diff=$(cmp "$temp" "$file")
-        ret=$?
         if $verbose; then
             echo "$diff"
         fi
     fi
-    return $ret
+    return 0
 }
 cedit "$@"