diff --git a/bin/plot_cpu_temp.sh b/bin/plot_cpu_temp.sh index 49b157a..eceac36 100755 --- a/bin/plot_cpu_temp.sh +++ b/bin/plot_cpu_temp.sh @@ -1,12 +1,27 @@ #!/bin/bash +usage() { + local name=${0##*/} + + cat <<-EOF + Usage: ${name} [-h || --help] + + Generates graph of the <logfile> and writes it to <outfile> + EOF +} + +if [[ "$1" == "-h" || "$1" == "--help" ]]; then + usage + exit 0 +fi + # Eingabeparameter LOGFILE="${1}" OUTFILE="${2}" TITLE="${3}" if [ -z "$LOGFILE" ] || [ -z "$OUTFILE" ] || [ -z "$TITLE" ]; then - echo "Usage: ${0} <temp.log> <output.png> <title>" + usage exit 1 fi diff --git a/bin/plot_cpu_temp_compare.sh b/bin/plot_cpu_temp_compare.sh index 99bb286..75d000a 100755 --- a/bin/plot_cpu_temp_compare.sh +++ b/bin/plot_cpu_temp_compare.sh @@ -5,8 +5,23 @@ ICE_LOG="${2}" OUTFILE="${3}" TITLE="${4} +usage() { + local name=${0##*/} + + cat <<-EOF + Usage: ${name} [-h || --help] <logfile>i <logfile2> <outfile> <title> + + Generates graph of the <logfile> and <logfile2> and writes it to <outfile> + EOF +} + +if [[ "$1" == "-h" || "$1" == "--help" ]]; then + usage + exit 0 +fi + if [ -z "${ACTIVE_LOG}" ] || [ -z "${ICE_LOG}" ] || [ -z "${OUTFILE}" ]; then - echo "Usage: $0 <temp_active.log> <temp_ice.log> <output.png>" + usage exit 1 fi