added usage()

This commit is contained in:
2026-01-24 09:14:36 +01:00
parent fb803c13f0
commit e9da74e3c8
2 changed files with 32 additions and 2 deletions

View File

@@ -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