From 25a29e7fea4fafe7c5ca3aad7e1accc396c174e9 Mon Sep 17 00:00:00 2001 From: kilo52 Date: Sat, 27 Jan 2024 20:45:51 +0100 Subject: [PATCH] Added check for mutually exclusive options. --- c/01_executable/source/build.sh | 5 +++++ c/02_library/source/build.sh | 5 +++++ cpp/01_executable/source/build.sh | 5 +++++ cpp/02_library/source/build.sh | 5 +++++ cpp/03_server-poco/source/build.sh | 5 +++++ cpp/04_desktop_imgui/source/build.sh | 5 +++++ 6 files changed, 30 insertions(+) diff --git a/c/01_executable/source/build.sh b/c/01_executable/source/build.sh index 34593fa..f36d902 100755 --- a/c/01_executable/source/build.sh +++ b/c/01_executable/source/build.sh @@ -89,6 +89,11 @@ if [[ $ARG_SHOW_HELP == true ]]; then exit 0; fi +if [[ $ARG_CONFIG == true && $ARG_SKIP_CONFIG == true ]]; then + echo "Cannot specify both --config and --skip-config options"; + exit 1; +fi + # Check clean flag if [[ $ARG_CLEAN == true ]]; then if [ -d "build" ]; then diff --git a/c/02_library/source/build.sh b/c/02_library/source/build.sh index e32b454..5b80388 100755 --- a/c/02_library/source/build.sh +++ b/c/02_library/source/build.sh @@ -97,6 +97,11 @@ if [[ $ARG_SHOW_HELP == true ]]; then exit 0; fi +if [[ $ARG_CONFIG == true && $ARG_SKIP_CONFIG == true ]]; then + echo "Cannot specify both --config and --skip-config options"; + exit 1; +fi + # Check clean flag if [[ $ARG_CLEAN == true ]]; then if [ -d "build" ]; then diff --git a/cpp/01_executable/source/build.sh b/cpp/01_executable/source/build.sh index 34593fa..f36d902 100755 --- a/cpp/01_executable/source/build.sh +++ b/cpp/01_executable/source/build.sh @@ -89,6 +89,11 @@ if [[ $ARG_SHOW_HELP == true ]]; then exit 0; fi +if [[ $ARG_CONFIG == true && $ARG_SKIP_CONFIG == true ]]; then + echo "Cannot specify both --config and --skip-config options"; + exit 1; +fi + # Check clean flag if [[ $ARG_CLEAN == true ]]; then if [ -d "build" ]; then diff --git a/cpp/02_library/source/build.sh b/cpp/02_library/source/build.sh index 655e4ed..c395352 100755 --- a/cpp/02_library/source/build.sh +++ b/cpp/02_library/source/build.sh @@ -97,6 +97,11 @@ if [[ $ARG_SHOW_HELP == true ]]; then exit 0; fi +if [[ $ARG_CONFIG == true && $ARG_SKIP_CONFIG == true ]]; then + echo "Cannot specify both --config and --skip-config options"; + exit 1; +fi + # Check clean flag if [[ $ARG_CLEAN == true ]]; then if [ -d "build" ]; then diff --git a/cpp/03_server-poco/source/build.sh b/cpp/03_server-poco/source/build.sh index c1d9d01..4e50de9 100755 --- a/cpp/03_server-poco/source/build.sh +++ b/cpp/03_server-poco/source/build.sh @@ -97,6 +97,11 @@ if [[ $ARG_SHOW_HELP == true ]]; then exit 0; fi +if [[ $ARG_CONFIG == true && $ARG_SKIP_CONFIG == true ]]; then + echo "Cannot specify both --config and --skip-config options"; + exit 1; +fi + # Check clean flag if [[ $ARG_CLEAN == true ]]; then if [ -d "build" ]; then diff --git a/cpp/04_desktop_imgui/source/build.sh b/cpp/04_desktop_imgui/source/build.sh index 652081f..aa95a8e 100755 --- a/cpp/04_desktop_imgui/source/build.sh +++ b/cpp/04_desktop_imgui/source/build.sh @@ -80,6 +80,11 @@ if [[ $ARG_SHOW_HELP == true ]]; then exit 0; fi +if [[ $ARG_CONFIG == true && $ARG_SKIP_CONFIG == true ]]; then + echo "Cannot specify both --config and --skip-config options"; + exit 1; +fi + # Check clean flag if [[ $ARG_CLEAN == true ]]; then if [ -d "build" ]; then