utils: Switch kata manager to use getopts

Use `getopts(1)` for command line argument parsing in
`kata-manager.sh`.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
This commit is contained in:
James O. D. Hunt 2022-02-15 08:55:54 +00:00
parent a3b3274121
commit 3f87835a0e

View File

@ -560,9 +560,16 @@ handle_installation()
handle_args()
{
case "${1:-}" in
-h|--help|help) usage; exit 0;;
local opt
while getopts "h" opt "$@"
do
case "$opt" in
h) usage; exit 0 ;;
esac
done
shift $[$OPTIND-1]
local kata_version="${1:-}"
local containerd_version="${2:-}"