File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -60,15 +60,31 @@ settingsProfile="Default"
6060selectedAnalysisDomain=" "
6161exploreMode=false
6262
63+ # Function to check if a parameter value is missing (either empty or another option starting with --)
64+ is_missing_value_parameter () {
65+ case " ${2:- } " in
66+ ' ' |--* ) return 0 ;; # missing value
67+ * ) return 1 ;; # value is present
68+ esac
69+ }
70+
6371# Parse command line arguments
6472while [[ $# -gt 0 ]]; do
6573 key=" $1 "
6674 case $key in
6775 --report)
76+ if is_missing_value_parameter " $1 " " $2 " ; then
77+ echo " analyze: Error: --report requires a value."
78+ usage
79+ fi
6880 analysisReportCompilation=" $2 "
6981 shift
7082 ;;
7183 --profile)
84+ if is_missing_value_parameter " $1 " " $2 " ; then
85+ echo " analyze: Error: --profile requires a value."
86+ usage
87+ fi
7288 settingsProfile=" $2 "
7389 shift
7490 ;;
@@ -77,6 +93,10 @@ while [[ $# -gt 0 ]]; do
7793 shift
7894 ;;
7995 --domain)
96+ if is_missing_value_parameter " $1 " " $2 " ; then
97+ echo " analyze: Error: --domain requires a value."
98+ usage
99+ fi
80100 selectedAnalysisDomain=" $2 "
81101 shift
82102 ;;
You can’t perform that action at this time.
0 commit comments