Skip to content

Commit

Permalink
Add error messages on usage of command line (#27559)
Browse files Browse the repository at this point in the history
* Add error messages on usage of command line

* remove a non yes/no argument

* Update error syntax for 2 more arguments

* update the help. using both true/false and yes/no is a mess
  • Loading branch information
andy31415 authored and pull[bot] committed Sep 29, 2023
1 parent 4a312dc commit 8ffb532
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions scripts/build_python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ help() {
echo "General Options:
-h, --help Display this information.
Input Options:
-d, --chip_detail_logging ChipDetailLoggingValue Specify ChipDetailLoggingValue as true or false.
-d, --chip_detail_logging <true/false> Specify ChipDetailLoggingValue as true or false.
By default it is false.
-m, --chip_mdns ChipMDNSValue Specify ChipMDNSValue as platform or minimal.
By default it is minimal.
-p, --enable_pybindings EnableValue Specify whether to enable pybindings as python controller.
-p, --enable_pybindings <true/false> Specify whether to enable pybindings as python controller.
-t --time_between_case_retries MRPActiveRetryInterval Specify MRPActiveRetryInterval value
Default is 300 ms
Expand All @@ -82,6 +82,10 @@ while (($#)); do
;;
--chip_detail_logging | -d)
chip_detail_logging=$2
if [[ "$chip_detail_logging" != "true" && "$chip_detail_logging" != "false" ]]; then
echo "chip_detail_logging should have a true/false value, not '$chip_detail_logging'"
exit
fi
shift
;;
--chip_mdns | -m)
Expand All @@ -90,6 +94,10 @@ while (($#)); do
;;
--enable_pybindings | -p)
enable_pybindings=$2
if [[ "$enable_pybindings" != "true" && "$enable_pybindings" != "false" ]]; then
echo "enable_pybindings should have a true/false value, not '$enable_pybindings'"
exit
fi
shift
;;
--time_between_case_retries | -t)
Expand All @@ -102,10 +110,18 @@ while (($#)); do
;;
--clean_virtual_env | -c)
clean_virtual_env=$2
if [[ "$clean_virtual_env" != "yes" && "$clean_virtual_env" != "no" ]]; then
echo "clean_virtual_env should have a yes/no value, not '$clean_virtual_env'"
exit
fi
shift
;;
--include_pytest_deps)
install_pytest_requirements=$2
if [[ "$install_pytest_requirements" != "yes" && "$install_pytest_requirements" != "no" ]]; then
echo "install_pytest_requirements should have a yes/no value, not '$install_pytest_requirements'"
exit
fi
shift
;;
--extra_packages)
Expand Down

0 comments on commit 8ffb532

Please sign in to comment.