aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/app-init25
1 files changed, 23 insertions, 2 deletions
diff --git a/bin/app-init b/bin/app-init
index bc4a0b2..bff92cf 100755
--- a/bin/app-init
+++ b/bin/app-init
@@ -9,13 +9,15 @@ export APPSH_HOME=$(cd $(dirname "$0")/.. && pwd)
# HEADER END
usage_text() {
- echo "usage: $usage_app -d dir <resolver> <resolver args>"
+ echo "usage: $usage_app [-s group.name=value] -d dir <resolver> <resolver args>"
}
dir=
prepend_config=
append_config=
-while getopts "d:C:c:" opt
+declare -A conf
+conf=()
+while getopts "d:C:c:s:" opt
do
case $opt in
d)
@@ -41,6 +43,19 @@ do
shift 2
OPTIND=1
;;
+ s)
+ keyvalue=$OPTARG
+ re="^$key_expr\\.$key_expr=.*$"
+ if [[ ! $keyvalue =~ $re ]]
+ then
+ usage "Invalid -s argument."
+ fi
+ key="${keyvalue%%=*}"
+ value="${keyvalue#*=}"
+ conf[$key]="$value"
+ shift 2
+ OPTIND=1
+ ;;
esac
done
@@ -77,6 +92,12 @@ trap '[[ $ok == yes ]] || rm -rf "$clean_dir"' EXIT
cd "$dir"
+for key in "${!conf[@]}"
+do
+ app-conf set $key "${conf[$key]}"
+done
+unset IFS
+
app-conf set app.resolver "$resolver_name"
"$resolver" init "$@"