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
|
print_help
|
||||||
fi
|
fi
|
||||||
|
|
||||||
function get_next_arg {
|
|
||||||
i=$((i+1))
|
|
||||||
safeprint "${args[i]}"
|
|
||||||
}
|
|
||||||
|
|
||||||
while [ $i -lt $args_count ]
|
while [ $i -lt $args_count ]
|
||||||
do
|
do
|
||||||
case "${args[i]}" in
|
case "${args[i]}" in
|
||||||
@ -81,10 +76,12 @@ do
|
|||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
'-c' | '--config')
|
'-c' | '--config')
|
||||||
project_config_path="$(get_next_arg)"
|
i=$((i+1))
|
||||||
|
project_config_path="${args[i]}"
|
||||||
;;
|
;;
|
||||||
'-n' | '--new-project')
|
'-n' | '--new-project')
|
||||||
new_project_dir="$(get_next_arg)"
|
i=$((i+1))
|
||||||
|
new_project_dir="${args[i]}"
|
||||||
if [ -z "$new_project_dir" ]; then
|
if [ -z "$new_project_dir" ]; then
|
||||||
new_project_dir="."
|
new_project_dir="."
|
||||||
fi
|
fi
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user