updating Usage output and standardizing target variable

This commit is contained in:
Christer Edwards
2019-11-22 22:05:37 -07:00
parent 72cbac6504
commit 4dd5579149
+4 -2
View File
@@ -32,7 +32,7 @@
. /usr/local/etc/bastille/bastille.conf . /usr/local/etc/bastille/bastille.conf
usage() { usage() {
echo -e "${COLOR_RED}Usage: bastille template TARGET template/path.${COLOR_RESET}" echo -e "${COLOR_RED}Usage: bastille template TARGET project/template.${COLOR_RESET}"
exit 1 exit 1
} }
@@ -48,6 +48,7 @@ if [ $# -gt 2 ] || [ $# -lt 2 ]; then
fi fi
TARGET="${1}" TARGET="${1}"
shift
if [ "${TARGET}" = 'ALL' ]; then if [ "${TARGET}" = 'ALL' ]; then
JAILS=$(jls name) JAILS=$(jls name)
@@ -56,7 +57,8 @@ if [ "${TARGET}" != 'ALL' ]; then
JAILS=$(jls name | grep -w "${TARGET}") JAILS=$(jls name | grep -w "${TARGET}")
fi fi
TEMPLATE="${2}" TEMPLATE="${1}"
shift
if [ ! -d "${bastille_templatesdir}"/"${TEMPLATE}" ]; then if [ ! -d "${bastille_templatesdir}"/"${TEMPLATE}" ]; then
echo -e "${COLOR_RED}${TEMPLATE} not found.${COLOR_RESET}" echo -e "${COLOR_RED}${TEMPLATE} not found.${COLOR_RESET}"