mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-25 15:06:14 +01:00
completion: Split declaration and assignment of variables
Having them on the same line masks failure of the subcommand generating the value being assigned. Spotted by shellcheck. Signed-off-by: Philip Withnall <pwithnall@gnome.org>
This commit is contained in:
parent
a7ad2a4c3a
commit
d3d811f4e5
@ -9,9 +9,11 @@
|
|||||||
|
|
||||||
__gdbus() {
|
__gdbus() {
|
||||||
local IFS=$'\n'
|
local IFS=$'\n'
|
||||||
local cur="$(_get_cword :)"
|
local cur
|
||||||
|
cur="$(_get_cword :)"
|
||||||
|
|
||||||
local suggestions="$(gdbus complete "${COMP_LINE}" "${COMP_POINT}")"
|
local suggestions
|
||||||
|
suggestions="$(gdbus complete "${COMP_LINE}" "${COMP_POINT}")"
|
||||||
COMPREPLY=($(compgen -W "$suggestions" -- "$cur"))
|
COMPREPLY=($(compgen -W "$suggestions" -- "$cur"))
|
||||||
|
|
||||||
# Remove colon-word prefix from COMPREPLY items
|
# Remove colon-word prefix from COMPREPLY items
|
||||||
|
@ -71,7 +71,8 @@ __gio_location() {
|
|||||||
local name size type
|
local name size type
|
||||||
while IFS=$'\t' read name size type; do
|
while IFS=$'\t' read name size type; do
|
||||||
# Escape name properly
|
# Escape name properly
|
||||||
local escaped_name="$(printf "%q" "$name")"
|
local escaped_name
|
||||||
|
escaped_name="$(printf "%q" "$name")"
|
||||||
|
|
||||||
# Append slash for directories and space for files
|
# Append slash for directories and space for files
|
||||||
if [[ "$type" == "(directory)" ]]; then
|
if [[ "$type" == "(directory)" ]]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user