summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xscripts/build/clean30
1 files changed, 17 insertions, 13 deletions
diff --git a/scripts/build/clean b/scripts/build/clean
index 8851305b0..b28cdcd2d 100755
--- a/scripts/build/clean
+++ b/scripts/build/clean
@@ -23,7 +23,7 @@ fi
# Setting static variables
DESCRIPTION="Clean up system build directories"
-USAGE="${PROGRAM} [--all] [--cache] [--chroot] [--binary] [--purge] [--remove] [--stage] [--source]"
+USAGE="${PROGRAM} [--all] [--cache] [--chroot] [--binary] [--purge] [--remove] [--stage] [--source] [COMMON_OPTIONS]"
# Reading, preparing and validating config
Read_conffiles $(Common_conffiles)
@@ -39,11 +39,10 @@ fi
Remove_lockfile
-if [ $# -eq 0 ]; then
- set -- "--all"
-fi
+ACTION_SELECTED="false"
for ARGUMENT in "${@}"; do
+ IS_ACTION="true"
case "${ARGUMENT}" in
--all)
RM_ALL="true"
@@ -77,17 +76,19 @@ for ARGUMENT in "${@}"; do
RM_SOURCE="true"
;;
- -h|--help)
- Man
- ;;
-
- -u|--usage)
- Usage --exit
+ *)
+ IS_ACTION="false"
;;
+ esac
+ if [ "${IS_ACTION}" = "true" ]; then
+ ACTION_SELECTED="true"
+ continue
+ fi
- -v|--version)
- echo "${VERSION}"
- exit 0
+ case "${ARGUMENT}" in
+ --breakpoints|--color|--debug|--force|-h|--help|--no-color|--quiet|-u|--usage|--verbose|-v|--version)
+ Handle_common_option "${ARGUMENT}"
+ shift
;;
*)
@@ -96,6 +97,9 @@ for ARGUMENT in "${@}"; do
;;
esac
done
+if [ "${ACTION_SELECTED}" = "false" ]; then
+ RM_ALL="true"
+fi
STAGEFILES_DIR="$(Stagefiles_dir)"