History

scripts/decode_stacktrace.sh: add '-h' flag

When no parameters are passed, the usage instructions are presented only when debuginfod-find is not found. This makes sense because with debuginfod none of the positional parameters are needed. However it means that users having debuginfod-find installed will have no chance of reading the usage text without opening the file. Many programs have a '-h' flag to get the usage, so add such a flag. Invoking 'scripts/decode_stacktrace.sh -h' will now show the usage text and exit.

Luca Ceresoli committed 2 years ago

Commit 7e108351 parent a6d05e81 file · +5 −1Browse files

Showing the changes to scripts/decode_stacktrace.sh (1 of 1 file). Show all

Unified · Split

scripts/decode_stacktrace.sh+5−1
@@ -7,6 +7,7 @@ usage() { · 6 unmodified lines
7 echo "Usage:"7 echo "Usage:"
8 echo " $0 -r <release>"8 echo " $0 -r <release>"
9 echo " $0 [<vmlinux> [<base_path>|auto [<modules_path>]]]"9 echo " $0 [<vmlinux> [<base_path>|auto [<modules_path>]]]"
10 echo " $0 -h"
10}11}
11 12
12# Try to find a Rust demangler13# Try to find a Rust demangler
@@ -33,7 +34,10 @@ READELF=${UTIL_PREFIX}readelf${UTIL_SUFFIX} · 20 unmodified lines
33ADDR2LINE=${UTIL_PREFIX}addr2line${UTIL_SUFFIX}34ADDR2LINE=${UTIL_PREFIX}addr2line${UTIL_SUFFIX}
34NM=${UTIL_PREFIX}nm${UTIL_SUFFIX}35NM=${UTIL_PREFIX}nm${UTIL_SUFFIX}
35 36
36if [[ $1 == "-r" ]] ; then37if [[ $1 == "-h" ]] ; then
38 usage
39 exit 0
40elif [[ $1 == "-r" ]] ; then
37 vmlinux=""41 vmlinux=""
38 basepath="auto"42 basepath="auto"
39 modpath=""43 modpath=""