bootstrap help and version list
This commit is contained in:
14
cbuild.sh
14
cbuild.sh
@@ -47,11 +47,12 @@ include "cbuild/config.sh"
|
||||
function print_help {
|
||||
myprint "cbuild v$INSTALLED_CBUILD_VERSION"
|
||||
myprint "C/C++ project build system written in bash."
|
||||
myprint "Usage: cbuild [OPTIONS] [TASK]"
|
||||
myprint " -h, --help Show this message"
|
||||
myprint " -v, --version Shows version"
|
||||
myprint " -n, --new-project [PROJ_DIR] Initialize new cbuild project directory (default=./)"
|
||||
myprint " -c, --config FILE Set project config file path (default=./project.config)"
|
||||
myprint "Usage: cbuild [OPTIONS] [TASKS]"
|
||||
myprint "Options:"
|
||||
myprint " -h, --help Show this message"
|
||||
myprint " -v, --version Shows version"
|
||||
myprint " -c, --config FILE Set project config file path (default=./project.config)"
|
||||
myprint " -n, --new-project [DIR] Initialize new cbuild project directory (default=./)"
|
||||
}
|
||||
|
||||
# parse command line arguments
|
||||
@@ -62,6 +63,7 @@ selected_tasks_array=()
|
||||
i=0
|
||||
if [ $args_count -eq 0 ]; then
|
||||
print_help
|
||||
exit 1
|
||||
fi
|
||||
|
||||
while [ $i -lt $args_count ]
|
||||
@@ -84,6 +86,8 @@ do
|
||||
new_project_dir="${args[i]}"
|
||||
if [ -z "$new_project_dir" ]; then
|
||||
new_project_dir="."
|
||||
else
|
||||
mkdir -p "$new_project_dir"
|
||||
fi
|
||||
if ask_yn "create default cbuild project config?"; then
|
||||
project_config_path="$new_project_dir/project.config"
|
||||
|
||||
Reference in New Issue
Block a user