From 94e30b12278fc135e9f73d4bb00cb8bf4605988a Mon Sep 17 00:00:00 2001 From: Sebastian Schuberth Date: Mon, 9 Sep 2024 10:09:54 +0200 Subject: [PATCH] feat(scripts): Add a script to generate all CLI completion scripts Signed-off-by: Sebastian Schuberth --- scripts/generate_completion_scripts.sh | 27 ++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 scripts/generate_completion_scripts.sh diff --git a/scripts/generate_completion_scripts.sh b/scripts/generate_completion_scripts.sh new file mode 100755 index 0000000000000..56e22540d6f35 --- /dev/null +++ b/scripts/generate_completion_scripts.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash +# +# Copyright (C) 2024 The ORT Project Authors (see ) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 +# License-Filename: LICENSE + +GIT_ROOT=$(git rev-parse --show-toplevel) + +(cd $GIT_ROOT && + ./gradlew -q :cli:installDist && + cli/build/install/ort/bin/ort --generate-completion=bash > integrations/completions/ort-completion.bash && + cli/build/install/ort/bin/ort --generate-completion=fish > integrations/completions/ort-completion.fish && + cli/build/install/ort/bin/ort --generate-completion=zsh > integrations/completions/ort-completion.zsh +)