From 0fb8ed80cee664efb8d46143c20004b504838836 Mon Sep 17 00:00:00 2001 From: Grant Orndorff Date: Fri, 3 Nov 2023 08:59:15 +0200 Subject: [PATCH] cli: autocomplete >1 service for enable/disable --- tools/ua.bash | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/tools/ua.bash b/tools/ua.bash index 8b80bffed3..c655a8333f 100644 --- a/tools/ua.bash +++ b/tools/ua.bash @@ -34,7 +34,22 @@ _ua_complete() esac ;; *) - COMPREPLY=() + local subcmd + subcmd="${COMP_WORDS[1]}" + case ${subcmd} in + disable) + # shellcheck disable=SC2207 + COMPREPLY=($(compgen -W "$SERVICES" -- $cur_word)) + ;; + enable) + # shellcheck disable=SC2207 + COMPREPLY=($(compgen -W "$SERVICES" -- $cur_word)) + ;; + *) + COMPREPLY=() + ;; + + esac ;; esac }