Work in progress on simplifying instantiation.
This commit is contained in:
parent
8bff482066
commit
d12c36aa2a
7 changed files with 30 additions and 60 deletions
|
|
@ -1,6 +1,6 @@
|
|||
if [ $# -ne 2 ]
|
||||
if [ $# -ne 1 ]
|
||||
then
|
||||
print_failure "Not enough arguments after module; need HEADER_NAME."
|
||||
print_failure "Wrong number of arguments after module; need HEADER_NAME."
|
||||
echo "HEADER_NAME is the name of the header file."
|
||||
exit 1
|
||||
fi
|
||||
|
|
@ -8,12 +8,6 @@ fi
|
|||
HEADER_NAME=$1
|
||||
shift
|
||||
|
||||
if [ -e src/${NAME} ]
|
||||
then
|
||||
print_failure "src/${NAME} already exists."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "$(echo ${NAME} | cut -b1-3)" != "lib" ]
|
||||
then
|
||||
echo "Warning: your module name does not begin with 'lib'. You will"
|
||||
|
|
@ -23,15 +17,7 @@ else
|
|||
NAMEMINUSL="-l$(echo ${NAME} | sed -e 's,^lib,,')"
|
||||
fi
|
||||
|
||||
echo "Instantiating module src/${NAME}..."
|
||||
|
||||
do_cmd mkdir src/${NAME} || exit 1
|
||||
do_cmd cp ${TEMPLATE}/* src/${NAME} || exit 1
|
||||
|
||||
do_cmd cd src/${NAME} || exit 1
|
||||
do_cmd rm instantiate || exit 1
|
||||
do_parameter_subst NAMEMINUSL HEADER_NAME
|
||||
|
||||
true
|
||||
|
||||
# kate: replace-trailing-space-save true; space-indent true; tab-width 4;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue