File tree Expand file tree Collapse file tree 1 file changed +38
-1
lines changed Expand file tree Collapse file tree 1 file changed +38
-1
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,34 @@ BACKENDRUNNER=(@BACKEND_RUNNER_SPACED@)
2323declare -a ARGS
2424SHOW=" eval"
2525BACKEND=${BACKENDS[0]}
26+ help=" no"
27+
28+ function print_help {
29+ local this_bin=" $1 "
30+ local BACKEND=$2
31+ local RUNNER=$3
32+
33+ echo " * Runs an ALP/GraphBLAS binary by calling an underlying runner and by passing needed flags."
34+ echo
35+ echo " USAGE: ${this_bin} [ALP-specific options...] [--] [runner arguments...] <ALP/GraphBLAS binary> [binary arguments...]"
36+ echo
37+ echo " ALP-specific options:"
38+ echo " -b,--backend <backend> run against the ALP/GraphBLAS backend <backend>; possible values: ${BACKENDS[@]} ; default: reference"
39+ echo " --show show the full run command WITHOUT executing it"
40+ echo " --help display this help"
41+ echo " -- <args...> pass all the following <args...> arguments directly to the underlying runner"
42+ echo
43+ echo " * Selected backend: ${BACKEND} "
44+ if [[ -z " ${RUNNER} " ]]; then
45+ # shared-memory backends have no runner
46+ echo " * No custom runner: running the given ALP/GraphBLAS binary directly"
47+ else
48+ echo " * Underlying runner: ${RUNNER} "
49+ echo " * Underlying runner help:"
50+ echo
51+ exec ${RUNNER} --help
52+ fi
53+ }
2654
2755while [[ $# -gt 0 ]]; do
2856 option=" $1 "
@@ -35,6 +63,9 @@ while [[ $# -gt 0 ]]; do
3563 --show)
3664 SHOW=echo
3765 ;;
66+ --help)
67+ help=" yes"
68+ ;;
3869 --)
3970 break
4071 ;;
6293RUNNER=${BACKENDRUNNER[${BACKENDID}]}
6394LD_PATH=" @ALP_UTILS_INSTALL_DIR@:${BACKENDRUNENV[${BACKENDID}]} "
6495
65- ${SHOW} LD_LIBRARY_PATH=" ${LD_PATH} :${LD_LIBRARY_PATH} " ${RUNNER} " ${ARGS[@]} " " $@ "
96+ if [[ " ${help} " == " yes" ]]; then
97+ print_help " $( realpath $0 ) " ${BACKEND} ${RUNNER}
98+ exit 0
99+ fi
100+
101+ ${SHOW} LD_LIBRARY_PATH=" \" ${LD_PATH} :${LD_LIBRARY_PATH} \" " ${RUNNER} " ${ARGS[@]} " " $@ "
102+
You can’t perform that action at this time.
0 commit comments