allowed user to pass arguments to run

This commit is contained in:
Noah Swerhun 2021-12-24 11:03:10 -06:00
parent 1059f7b43d
commit 9e7cd161c6

View file

@ -49,13 +49,13 @@ Usage:
./cbuild.sh [COMMAND]
COMMAND:
build generate the makefile, compile objects and link target.
clean remove makefile, objects, and target.
buildcn clean, and then build.
generate ONLY generate the makefile.
run build, then execute TARGET.
dryrun print all commands that will be executed during the build process
to stdout.
build generate the makefile, compile objects and link target.
clean remove makefile, objects, and target.
buildcn clean, and then build.
generate ONLY generate the makefile.
run [ARGS] build, then execute TARGET with arguments ARGS.
dryrun print all commands that will be executed during the build process
to stdout.
EOF
}
@ -138,7 +138,7 @@ clean() {
run() {
build || exit $?
info "Running ./${TARGET}"
"./${TARGET}" ||
"./${TARGET}" $@ ||
err "Run FAILURE ./${TARGET} returned $?"
}
@ -169,7 +169,7 @@ case $1 in
clean) clean;;
buildcn) clean ; build;;
generate) gen_makefile && info "Done";;
run) run;;
run) shift 1 && run $@;;
dryrun) dry_run;;
__progress__) __progress__ "${2}" "${3}";;
*) usage;;