We no longer support any form of long options. Fixes #28.

Added missing opt strings, `-M|-N|-S`.
This commit is contained in:
Pedro Algarvio 2013-01-25 17:57:12 +00:00
parent 2fdbb1d12a
commit eed8d83b3e
2 changed files with 21 additions and 25 deletions

View file

@ -45,8 +45,8 @@ passed_echo() {
title_echo "Running checkbashisms"
/usr/bin/checkbashisms -pxfn bootstrap-salt-minion.sh && passed_echo || failed_echo
title_echo "Double dashed long options are errors and explained to the user"
/bin/bash bootstrap-salt-minion.sh --help | grep "Long options are NOT double-dash prefixed" && passed_echo || failed_echo
title_echo "Passing '-N'(no minion) without passing '-M'(install master) or '-S'(install syndic) fails"
./bootstrap-salt-minion.sh -N && failed_echo || passed_echo
title_echo "Installing using bash"
(sudo /bin/bash bootstrap-salt-minion.sh && salt-minion --versions-report && sudo apt-get remove salt-common salt-minion) && passed_echo || failed_echo

View file

@ -45,12 +45,12 @@ usage() {
$ ${ScriptName} git 8c3fadf15ec183e5ce8c63739850d543617e4357
Options:
-h|-help Display this message
-v|-version Display script version
-c|-config-dir Temporary minion configuration directory
-M|-master Also install salt-master
-S|-syndic Also install salt-syndic
-N|-no-minion Do not install salt-minion
-h Display this message
-v Display script version
-c Temporary minion configuration directory
-M Also install salt-master
-S Also install salt-syndic
-N Do not install salt-minion
EOT
} # ---------- end of function usage ----------
@ -62,27 +62,23 @@ INSTALL_MASTER=0
INSTALL_SYNDIC=0
INSTALL_MINION=1
while getopts ":hvc:" opt
while getopts ":hvc:MSN" opt
do
case $opt in
case "${opt}" in
h|help ) usage; exit 0 ;;
h ) usage; exit 0 ;;
v|version ) echo "$0 -- Version $ScriptVersion"; exit 0 ;;
c|config-dir ) TEMP_CONFIG_DIR="$OPTARG" ;;
M|master ) INSTALL_MASTER=1 ;;
S|syndic ) INSTALL_SYNDIC=1 ;;
N|no-minion ) INSTALL_MINION=0 ;;
v ) echo "$0 -- Version $ScriptVersion"; exit 0 ;;
c ) TEMP_CONFIG_DIR="$OPTARG" ;;
M ) INSTALL_MASTER=1 ;;
S ) INSTALL_SYNDIC=1 ;;
N ) INSTALL_MINION=0 ;;
\? ) echo
if [ "$OPTARG" = "-" ]; then
echo " Long options are NOT double-dash prefixed"
else
echo " Option does not exist : $OPTARG"
fi
usage
exit 1
;;
\?) echo
echo " Option does not exist : $OPTARG"
usage
exit 1
;;
esac # --- end of case ---
done