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