Skip to content

Commit

Permalink
+ completions: gcloud: if present on the system, source its completions
Browse files Browse the repository at this point in the history
we might regret the expense of doing this, but for now we'll be using it
often so let's add it.  same caveat exists as did for incus: we should
eventually hide completions behind a "completion activate" function and
only do it when called upon
  • Loading branch information
smemsh committed Dec 11, 2024
1 parent 2806b6d commit 0aa73d0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions init.d/completions
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,13 @@ shell_init_completions_incus ()
fi
}

shell_init_completions_gcloud ()
{
((BASH_VERSINFO < 5)) && return # TODO not sure this is necessary?
[[ $(type -P gcloud) ]] || return
source /usr/share/google-cloud-sdk/completion.bash.inc &>/dev/null
}

##############################################################################
#
# these are retained after we exit, used by the completion
Expand Down

0 comments on commit 0aa73d0

Please sign in to comment.