kata-deploy: Return exit code for invalid argument

It hangs when invalid arguments are specified.

```bash
kata-deploy-6sr2p:/# /opt/kata-artifacts/scripts/kata-deploy.sh xxx
Action:
* xxx
...
Usage: /opt/kata-artifacts/scripts/kata-deploy.sh [install/cleanup/reset]
ERROR: invalid arguments
...
^C <- hang
```

I changed it to behave the same as when there are no arguments.

```bash
kata-deploy-6sr2p:/# /opt/kata-artifacts/scripts/kata-deploy.sh
Usage: /opt/kata-artifacts/scripts/kata-deploy.sh [install/cleanup/reset]
ERROR: invalid arguments
kata-deploy-6sr2p:/# echo $?
1
```

Fixes: #11068

Signed-off-by: Shunsuke Kimura <pbrehpuum@gmail.com>
This commit is contained in:
Shunsuke Kimura 2025-03-22 21:23:44 +09:00
parent 810a6dafad
commit e5d7414c33

View File

@ -909,8 +909,8 @@ function main() {
reset_runtime $runtime
;;
*)
echo invalid arguments
print_usage
die "invalid arguments"
;;
esac
fi