X-Git-Url: https://iankelling.org/git/?p=cedit;a=blobdiff_plain;f=cedit;h=7fbf7439338b159685d527cbb32ea5c191bbab76;hp=68efcae69398a0cb73e60134eaa9972c2579db0d;hb=6f89fb66315647b6421e44abe5a49789efc9dbdc;hpb=6cc921147f723f23586dd0b0b036e028e90c8e3d diff --git a/cedit b/cedit index 68efcae..7fbf743 100755 --- a/cedit +++ b/cedit @@ -13,13 +13,25 @@ # See the License for the specific language governing permissions and # limitations under the License. -cedit() { # [-v] [section_name] FILE +cedit() { + local help="Usage: [-h|--help ] [-v] [SECTION_NAME] FILE +Create/modify a section in a config file +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 s diff name init local file_dir="$(dirname "$file")" local exists=true local verbose=false + case $1 in + -h|--help) echo "$help"; return ;; + esac + if [[ $1 == -v ]]; then verbose=true shift