-
Notifications
You must be signed in to change notification settings - Fork 0
/
gen.source.fromto
executable file
·27 lines (27 loc) · 1.48 KB
/
gen.source.fromto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash
case $optional_flag in
1)
if [[ -z "${keywords[$tovar]}" ]] ; then
eval "declare -A keywords[$tovar]=\"\${$fromvar}\""
elif [[ "${keywords[$tovar]}" != "${!fromvar}" ]] ; then
echo "gen.source.fromto error: in {${filename}} | {${keywords[sname]}}, folder {/${PWD##*/}}: customized {$tovar} value {${!fromvar}} /= already there value ${keywords[$tovar]}. Comment: {$fromto_comment}"
exit 64
fi
;;
0)
if [[ -z "${keywords[$tovar]}" ]] ; then
eval "declare -A keywords[$tovar]=\"\${$fromvar}\""
elif [[ "${keywords[$tovar]}" != "${!fromvar}" ]] ; then
echo "gen.source.fromto warning: in {${filename}} | {${keywords[sname]}}, folder {/${PWD##*/}}: attempted to othercust customize {$tovar} value {${!fromvar}}, but value ${keywords[$tovar]} is already there. othercust not mandatory, given up. Comment: {$fromto_comment}"
fi
;;
*)
echo "gen.source.fromto warning: in {${filename}} | {${keywords[sname]}}, folder {/${PWD##*/}}: the script was called without optional_flag specified. Comment: {$fromto_comment}"
if [[ -z "${keywords[$tovar]}" ]] ; then
eval "declare -A keywords[$tovar]=\"\${$fromvar}\""
elif [[ "${keywords[$tovar]}" != "${!fromvar}" ]] ; then
echo "gen.source.fromto error: in {${filename}} | {${keywords[sname]}}, folder {/${PWD##*/}}: customized {$tovar} value {${!fromvar}} /= already there value {${keywords[$tovar]}}. Comment: {$fromto_comment}"
exit 64
fi
;;
esac