allowed user to pass arguments to run
This commit is contained in:
parent
1059f7b43d
commit
9e7cd161c6
1 changed files with 9 additions and 9 deletions
18
cbuild.sh
18
cbuild.sh
|
@ -49,13 +49,13 @@ Usage:
|
||||||
./cbuild.sh [COMMAND]
|
./cbuild.sh [COMMAND]
|
||||||
|
|
||||||
COMMAND:
|
COMMAND:
|
||||||
build generate the makefile, compile objects and link target.
|
build generate the makefile, compile objects and link target.
|
||||||
clean remove makefile, objects, and target.
|
clean remove makefile, objects, and target.
|
||||||
buildcn clean, and then build.
|
buildcn clean, and then build.
|
||||||
generate ONLY generate the makefile.
|
generate ONLY generate the makefile.
|
||||||
run build, then execute TARGET.
|
run [ARGS] build, then execute TARGET with arguments ARGS.
|
||||||
dryrun print all commands that will be executed during the build process
|
dryrun print all commands that will be executed during the build process
|
||||||
to stdout.
|
to stdout.
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -138,7 +138,7 @@ clean() {
|
||||||
run() {
|
run() {
|
||||||
build || exit $?
|
build || exit $?
|
||||||
info "Running [0m./${TARGET}"
|
info "Running [0m./${TARGET}"
|
||||||
"./${TARGET}" ||
|
"./${TARGET}" $@ ||
|
||||||
err "Run FAILURE [0m./${TARGET}[31m returned $?"
|
err "Run FAILURE [0m./${TARGET}[31m returned $?"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -169,7 +169,7 @@ case $1 in
|
||||||
clean) clean;;
|
clean) clean;;
|
||||||
buildcn) clean ; build;;
|
buildcn) clean ; build;;
|
||||||
generate) gen_makefile && info "Done";;
|
generate) gen_makefile && info "Done";;
|
||||||
run) run;;
|
run) shift 1 && run $@;;
|
||||||
dryrun) dry_run;;
|
dryrun) dry_run;;
|
||||||
__progress__) __progress__ "${2}" "${3}";;
|
__progress__) __progress__ "${2}" "${3}";;
|
||||||
*) usage;;
|
*) usage;;
|
||||||
|
|
Loading…
Reference in a new issue