ebc: implement --version option for pvics

For consistency reasons implement the --version option handling for the new
pvics tool.

Closes: https://github.com/ibm-s390-linux/s390-tools/pull/203
[seiden@linux.ibm.com: Add link to GH PR]
Signed-off-by: Dan Horák <dan@danny.cz>
Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Dan Horák
2026-06-04 08:15:48 +00:00
committed by Jan Höppner
parent d04ea8603d
commit 8bb20be528

View File

@@ -710,7 +710,8 @@ Actions:
echo "
Options:
-h, --help Show this help text"
-h, --help Show this help text
--version Show version information"
if [[ "${action}" == "[ACTION]" ]]; then
echo -e "\t-c, --config\t\tConfiguration yaml file"
fi
@@ -720,6 +721,13 @@ Options:
return 0
}
print_version() {
cat <<-EOD
$0: version %S390_TOOLS_VERSION%
Copyright IBM Corp.
EOD
}
#
# CLI FUNCTIONS
@@ -747,7 +755,7 @@ cli() {
shift
fi
temp=$(getopt -o 'hc:i:' --long 'help,config:,image:' -- "$@")
temp=$(getopt -o 'hc:i:' --long 'help,version,config:,image:' -- "$@")
if ! eval set -- "$temp"; then
usage
return 1
@@ -762,6 +770,10 @@ cli() {
usage
exit 0
;;
'--version')
print_version
exit 0
;;
'-c'|'--config')
case "$2" in
'')