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
77 echo "Usage:"
88 echo " $0 -r <release>"
99 echo " $0 [<vmlinux> [<base_path>|auto [<modules_path>]]]"
10+ echo " $0 -h"
1011 }
1112
1213 # Try to find a Rust demangler
@@ -33,7 +34,10 @@ READELF=${UTIL_PREFIX}readelf${UTIL_SUFFIX} · 20 unmodified lines
3334 ADDR2LINE=${UTIL_PREFIX}addr2line${UTIL_SUFFIX}
3435 NM=${UTIL_PREFIX}nm${UTIL_SUFFIX}
3536
36−if [[ $1 == "-r" ]] ; then
37+if [[ $1 == "-h" ]] ; then
38+ usage
39+ exit 0
40+elif [[ $1 == "-r" ]] ; then
3741 vmlinux=""
3842 basepath="auto"
3943 modpath=""