fixed command line arguments parsing
This commit is contained in:
parent
d021389637
commit
91dfc8bc74
11
cbuild.sh
11
cbuild.sh
@ -64,11 +64,6 @@ if [ $args_count -eq 0 ]; then
|
||||
print_help
|
||||
fi
|
||||
|
||||
function get_next_arg {
|
||||
i=$((i+1))
|
||||
safeprint "${args[i]}"
|
||||
}
|
||||
|
||||
while [ $i -lt $args_count ]
|
||||
do
|
||||
case "${args[i]}" in
|
||||
@ -81,10 +76,12 @@ do
|
||||
exit 0
|
||||
;;
|
||||
'-c' | '--config')
|
||||
project_config_path="$(get_next_arg)"
|
||||
i=$((i+1))
|
||||
project_config_path="${args[i]}"
|
||||
;;
|
||||
'-n' | '--new-project')
|
||||
new_project_dir="$(get_next_arg)"
|
||||
i=$((i+1))
|
||||
new_project_dir="${args[i]}"
|
||||
if [ -z "$new_project_dir" ]; then
|
||||
new_project_dir="."
|
||||
fi
|
||||
|
||||
Loading…
Reference in New Issue
Block a user