From b43861db2c0e4444d9c647e6838f3e2eefb48c5a Mon Sep 17 00:00:00 2001 From: slowpeek Date: Sat, 15 Oct 2022 18:38:44 +0300 Subject: [PATCH] -V, --version options --- README.org | 5 +++++ hddtemp | 21 ++++++++++++++++++--- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/README.org b/README.org index e17fb79..265760f 100644 --- a/README.org +++ b/README.org @@ -3,6 +3,11 @@ + =hddtemp= :: Show temps for all =sd= and =nvme= disks. + =hddtemp /dev/sda ...= :: Show temps for selected disks +Options: + +- =-h, --help= :: Show usage +- =-V, --version= :: Show version + * Requirements - =smartctl= (=smartmontools= package) diff --git a/hddtemp b/hddtemp index c08c73c..788817e 100755 --- a/hddtemp +++ b/hddtemp @@ -9,16 +9,23 @@ shopt -s nullglob # A very basic replacement for hddtemp tool missing from Ubuntu # 22.04. It requires smartctl (smartmontools package). +SCRIPT_VERSION=0.1 + bye() { echo "$@" >&2 exit 1 } +version() { + echo "$SCRIPT_VERSION" + exit +} + usage() { local self=${BASH_SOURCE[0]##*/} cat <