From f198cf8973013264d27693ea43c144695db0e362 Mon Sep 17 00:00:00 2001 From: DmitriyLewen <91113035+DmitriyLewen@users.noreply.github.com> Date: Tue, 30 Jul 2024 12:53:54 +0600 Subject: [PATCH] refactor(flag): return error if both `--download-db-only` and `--download-java-db-only` are specified (#7259) --- pkg/flag/db_flags.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/flag/db_flags.go b/pkg/flag/db_flags.go index 37685b104204..352a0094be7c 100644 --- a/pkg/flag/db_flags.go +++ b/pkg/flag/db_flags.go @@ -137,6 +137,9 @@ func (f *DBFlagGroup) ToOptions() (DBOptions, error) { downloadDBOnly := f.DownloadDBOnly.Value() downloadJavaDBOnly := f.DownloadJavaDBOnly.Value() + if downloadDBOnly && downloadJavaDBOnly { + return DBOptions{}, xerrors.New("--download-db-only and --download-java-db-only options can not be specified both") + } if downloadDBOnly && skipDBUpdate { return DBOptions{}, xerrors.New("--skip-db-update and --download-db-only options can not be specified both") }