iankelling.org
/
git
/
cedit
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6cc9211
)
add help arg
author
Ian Kelling
<ian@iankelling.org>
Mon, 15 Aug 2016 01:22:21 +0000
(18:22 -0700)
committer
Ian Kelling
<ian@iankelling.org>
Mon, 15 Aug 2016 01:22:21 +0000
(18:22 -0700)
cedit
patch
|
blob
|
history
diff --git
a/cedit
b/cedit
index 68efcae69398a0cb73e60134eaa9972c2579db0d..d04f587b62928d5ab9744bdccac5e890eb07b895 100755
(executable)
--- a/
cedit
+++ b/
cedit
@@
-13,13
+13,24
@@
# See the License for the specific language governing permissions and
# limitations under the License.
# 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
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
if [[ $1 == -v ]]; then
verbose=true
shift