glib/gio/completion
Philip Withnall 70c0f3bff6
completion: Rework quoting in gsettings completion script
This is a partial revert and rework of commit
c79575362e, for the `gsettings` script
only (the other completion scripts are fine).

I blindly added quoting to everything shellcheck told me to, without
testing it properly.

As it turns out, the `$schemadir` argument to `gsettings` invocations
was deliberately not quoted, so that it would expand to zero arguments
if unset, and two arguments (`--schemadir /some/path`) if set earlier in
the command-being-completed.

Quoting it meant that it expanded to one argument (the empty string) if
unset, which caused the `gsettings` subcommands to fail, and hence any
further tab completion to fail.

Fix that as suggested on https://www.shellcheck.net/wiki/SC2086 by
turning `schemadir` into an array, which either has zero members if
unset, or two members if set.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-04-17 17:43:50 +01:00
..
.gitignore gio: Add bash completion for gio tool 2018-06-15 12:34:10 +02:00
gapplication completion: Add missing copyright and licensing headers 2024-04-17 17:43:44 +01:00
gdbus completion: Add missing copyright and licensing headers 2024-04-17 17:43:44 +01:00
gio completion: Add missing copyright and licensing headers 2024-04-17 17:43:44 +01:00
gresource completion: Add missing copyright and licensing headers 2024-04-17 17:43:44 +01:00
gsettings completion: Rework quoting in gsettings completion script 2024-04-17 17:43:50 +01:00