Skip to content

Commit 48fdad4

Browse files
committed
hack/update-ubuntu-image.sh: add --flavor <flavor> flag
Signed-off-by: Norio Nomura <[email protected]>
1 parent 5144f1d commit 48fdad4

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

hack/update-ubuntu-image.sh

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ function print_help() {
55
$(basename "${BASH_SOURCE[0]}"): Update the Ubuntu image location in the specified templates
66
77
Usage:
8-
$(basename "${BASH_SOURCE[0]}") [--minimal|--server] [--version <version>] <template.yaml>...
8+
$(basename "${BASH_SOURCE[0]}") [--flavor <flavor>|--minimal|--server] [--version <version>] <template.yaml>...
99
1010
Description:
1111
This script updates the Ubuntu image location in the specified templates.
@@ -32,8 +32,9 @@ Examples:
3232
$ $(basename "${BASH_SOURCE[0]}") --minimal --version 24.04 ~/.lima/docker/lima.yaml
3333
3434
Flags:
35-
--server Use the server flavor image
36-
--minimal Use the minimal flavor image
35+
--flavor <flavor> Use the specified flavor image
36+
--server Shortcut for --flavor server
37+
--minimal Shortcut for --flavor minimal
3738
--version <version> Use the specified version
3839
-h, --help Print this help message
3940
HELP
@@ -186,6 +187,16 @@ while [[ $# -gt 0 ]]; do
186187
print_help
187188
exit 0
188189
;;
190+
--flavor)
191+
if [[ -n $2 && $2 != -* ]]; then
192+
flavor="$2"
193+
shift
194+
else
195+
echo "Error: --flavor requires a value" >&2
196+
exit 1
197+
fi
198+
;;
199+
--flavor=*) flavor="${1#*=}" ;;
189200
--minimal) flavor="minimal" ;;
190201
--server) flavor="server" ;;
191202
--version)

0 commit comments

Comments
 (0)