diff --git a/doc/lib-head+tail b/doc/lib-head+tail index d3c48f7..597257f 100644 --- a/doc/lib-head+tail +++ b/doc/lib-head+tail @@ -2,10 +2,12 @@ #remaster lib [ -d "" ] || { echo "LIBDIR not exist"; exit 1; } -#beginn func - +# [param] +function () { + #Code of +} #this func is standalone executable [ -n "$1" ] && { - check_user + $@ } diff --git a/script/add_function.sh b/script/add_function.sh new file mode 100755 index 0000000..17bd495 --- /dev/null +++ b/script/add_function.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +#check param +[ -z "$1" ] && { echo "$0 [name]"; exit 1; } +name="$1" + +#gen function +cp "doc/lib-head+tail" "src/func/$name" +sed -i "s//$name/g" "src/func/$name" + +#open +editor "src/func/$name"