mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-02 15:33:39 +02:00
completion: Invoke the command being completed
As suggested by Ville Skyttä in https://gitlab.gnome.org/GNOME/glib/-/merge_requests/4012#note_2084405, make sure to invoke the copy of the command which is being completed when asking for completions of a given subcommand. This avoids accidentally invoking any old `gdbus`/`gresource`/etc. binary which is hanging around in another part of `$PATH`. Signed-off-by: Philip Withnall <pwithnall@gnome.org>
This commit is contained in:
@@ -8,12 +8,15 @@
|
||||
|
||||
|
||||
__gdbus() {
|
||||
local gdbus_binary
|
||||
gdbus_binary="$1"
|
||||
|
||||
local IFS=$'\n'
|
||||
local cur
|
||||
cur="$(_get_cword :)"
|
||||
|
||||
local suggestions
|
||||
suggestions="$(gdbus complete "${COMP_LINE}" "${COMP_POINT}")"
|
||||
suggestions="$("$gdbus_binary" complete "${COMP_LINE}" "${COMP_POINT}")"
|
||||
# shellcheck disable=SC2207
|
||||
COMPREPLY=($(compgen -W "$suggestions" -- "$cur"))
|
||||
|
||||
|
Reference in New Issue
Block a user