kas-container: add an argument to get version information

This script is deployed in many copies, give people a way to identify
which one they have cached/installed.

Signed-off-by: Henning Schild <henning.schild@siemens.com>
[Jan: simplify and use basename for the program]
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
This commit is contained in:
Henning Schild 2021-02-25 20:42:27 +01:00 committed by Jan Kiszka
parent 8fe75298e4
commit 6b52357dc7

View File

@ -46,6 +46,7 @@ usage()
printf "%b" "--docker-args\t\tSame as --runtime-args (deprecated).\n"
printf "%b" "-d\t\t\tPrint debug output.\n"
printf "%b" "-v\t\t\tSame as -d (deprecated).\n"
printf "%b" "--version\t\tprint program version.\n"
printf "%b" "--ssh-dir\t\tDirectory containing SSH configurations.\n"
printf "%b" "\t\t\tAvoid \$HOME/.ssh unless you fully trust the " \
"container.\n"
@ -173,6 +174,10 @@ while [ $# -gt 0 ]; do
KAS_OPTIONS_DIRECT="${KAS_OPTIONS_DIRECT} -d"
shift 1
;;
--version)
echo "$(basename "$0") $KAS_IMAGE_VERSION_DEFAULT"
exit 0
;;
--*)
usage
;;