Simplify destroy options, no need to shift 1 on single options
This commit is contained in:
@@ -391,11 +391,11 @@ else
|
|||||||
## handle single options
|
## handle single options
|
||||||
case "${1}" in
|
case "${1}" in
|
||||||
-T|--thick|thick)
|
-T|--thick|thick)
|
||||||
shift 1
|
shift
|
||||||
THICK_JAIL="1"
|
THICK_JAIL="1"
|
||||||
;;
|
;;
|
||||||
-V|--vnet|vnet)
|
-V|--vnet|vnet)
|
||||||
shift 1
|
shift
|
||||||
VNET_JAIL="1"
|
VNET_JAIL="1"
|
||||||
;;
|
;;
|
||||||
-*)
|
-*)
|
||||||
|
|||||||
@@ -152,29 +152,30 @@ help|-h|--help)
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
OPTION="${1}"
|
## reset this options
|
||||||
TARGET="${2}"
|
FORCE=""
|
||||||
|
|
||||||
## handle additional options
|
## handle additional options
|
||||||
case "${OPTION}" in
|
case "${1}" in
|
||||||
-f|--force)
|
-f|--force|force)
|
||||||
if [ $# -gt 2 ] || [ $# -lt 2 ]; then
|
|
||||||
usage
|
|
||||||
fi
|
|
||||||
FORCE="1"
|
FORCE="1"
|
||||||
|
shift
|
||||||
;;
|
;;
|
||||||
-*)
|
-*)
|
||||||
echo -e "${COLOR_RED}Unknown Option.${COLOR_RESET}"
|
echo -e "${COLOR_RED}Unknown Option.${COLOR_RESET}"
|
||||||
usage
|
usage
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
if [ $# -gt 1 ] || [ $# -lt 1 ]; then
|
break
|
||||||
usage
|
|
||||||
fi
|
|
||||||
TARGET="${1}"
|
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
TARGET="${1}"
|
||||||
|
|
||||||
|
if [ $# -gt 1 ] || [ $# -lt 1 ]; then
|
||||||
|
usage
|
||||||
|
fi
|
||||||
|
|
||||||
## check what should we clean
|
## check what should we clean
|
||||||
case "${TARGET}" in
|
case "${TARGET}" in
|
||||||
*-RELEASE|*-release|*-RC1|*-rc1|*-RC2|*-rc2)
|
*-RELEASE|*-release|*-RC1|*-rc1|*-RC2|*-rc2)
|
||||||
|
|||||||
Reference in New Issue
Block a user