pull/23/head
6543 5 years ago
parent 3510f44ef8
commit 89053e3ed1
  1. 8
      doc/lib-head+tail
  2. 12
      script/add_function.sh

@ -2,10 +2,12 @@
#remaster lib
[ -d "<LIBDIR>" ] || { echo "LIBDIR not exist"; exit 1; }

#beginn func

#<function> [param]
function <function>() {
#Code of <function>
}

#this func is standalone executable
[ -n "$1" ] && {
check_user
<function> $@
}

@ -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/<function>/$name/g" "src/func/$name"

#open
editor "src/func/$name"
Loading…
Cancel
Save