From 9cc02c92c1630a410f64fa4cb747863d01e54947 Mon Sep 17 00:00:00 2001 From: Ian Kelling Date: Sun, 14 Aug 2016 18:22:21 -0700 Subject: [PATCH] add help arg --- cedit | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/cedit b/cedit index 68efcae..d04f587 100755 --- a/cedit +++ b/cedit @@ -13,13 +13,24 @@ # 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/edit a #comment delimited section of a 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. + +-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 -- 2.30.2