Skip to content

Commit 36364c5

Browse files
improving --help output
1 parent 773279d commit 36364c5

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

src/grbcxx.in

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,16 @@ function print_help {
4343
# LPF's lpfcxx doesn't recognize "--help", just "-help"
4444
help_arg="-help"
4545
fi
46+
local ALL_BACKENDS="${BACKENDS[@]}"
4647

4748
echo "* Compiles an ALP/GraphBLAS application by calling an underlying compiler and by passing needed flags."
4849
echo
49-
echo "USAGE: ${this_bin} [ALP-specific options...] [--] <compiler arguments...>"
50+
echo "Usage: ${this_bin} [ALP-specific options...] [--] <compiler arguments...>"
5051
echo
5152
echo "ALP-specific options:"
52-
echo " -b,--backend <backend> compile against the ALP/GraphBLAS backend <backend>; possible values: ${BACKENDS[@]}; default: reference"
53+
echo " -b,--backend <backend> compile against the ALP/GraphBLAS backend <backend>;"
54+
echo " possible values: ${ALL_BACKENDS// /, };"
55+
echo " default: ${BACKENDS[0]}"
5356
echo " --link-alp-static link the specified ALP/GraphBLAS backend statically (default linking is dynamic)"
5457
echo " --show show the full compilation command WITHOUT executing it"
5558
echo " --version display the current ALP/GraphBLAS version"
@@ -117,7 +120,13 @@ then
117120
fi
118121

119122
if [[ "${help}" == "yes" ]]; then
120-
print_help "$(realpath $0)" ${BACKEND} ${COMPILER}
123+
full_path="$0"
124+
# try calling realpath (if it exists) to get the full path
125+
real_path="$(realpath $0 2>&1)"
126+
if [[ "$?" == "0" ]]; then
127+
full_path=${real_path}
128+
fi
129+
print_help "${full_path}" "${BACKEND}" "${COMPILER}"
121130
exit 0
122131
fi
123132

src/grbrun.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ function print_help {
3232

3333
echo "* Runs an ALP/GraphBLAS binary by calling an underlying runner and by passing needed flags."
3434
echo
35-
echo "USAGE: ${this_bin} [ALP-specific options...] [--] [runner arguments...] <ALP/GraphBLAS binary> [binary arguments...]"
35+
echo "Usage: ${this_bin} [ALP-specific options...] [--] [runner arguments...] <ALP/GraphBLAS binary> [binary arguments...]"
3636
echo
3737
echo "ALP-specific options:"
3838
echo " -b,--backend <backend> run against the ALP/GraphBLAS backend <backend>; possible values: ${BACKENDS[@]}; default: reference"

0 commit comments

Comments
 (0)