mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-24 21:16:15 +01:00
gio: Complete also activation roots of volumes
Currently, "gio mount google-drive<tab>" isn't completed even though that volume exists for google-drive://oholy@redhat.com/. Let's use "gio mount -li" output to complete also activation roots of volumes.
This commit is contained in:
parent
3a1492ec4f
commit
8bc52105ef
@ -47,7 +47,7 @@ __gio_location() {
|
|||||||
dir=${cur%$(basename "$cur")}
|
dir=${cur%$(basename "$cur")}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# List daemon mounts, just if dir is not specified, or looks like scheme
|
# List mounts and volumes, just if dir is not specified, or looks like scheme
|
||||||
local mounts=()
|
local mounts=()
|
||||||
if [[ $dir == "" ]] || [[ $dir =~ ":"$ && ! $dir =~ "/" ]]; then
|
if [[ $dir == "" ]] || [[ $dir =~ ":"$ && ! $dir =~ "/" ]]; then
|
||||||
while IFS=$'\n' read mount; do
|
while IFS=$'\n' read mount; do
|
||||||
@ -56,7 +56,7 @@ __gio_location() {
|
|||||||
|
|
||||||
# Use only matching mounts
|
# Use only matching mounts
|
||||||
[[ "$mount" =~ ^"$cur" && "$mount" != "$cur" ]] && mounts+=("$mount")
|
[[ "$mount" =~ ^"$cur" && "$mount" != "$cur" ]] && mounts+=("$mount")
|
||||||
done < <(gio mount -l | sed -n -r 's/^ *Mount\([0-9]+\): .* -> (.*)$/\1/p')
|
done < <(gio mount -li | sed -n -r 's/^ *(default_location|activation_root)=(.*)$/\2/p' | sort -u)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Workaround to unescape dir name (e.g. "\ " -> " ")
|
# Workaround to unescape dir name (e.g. "\ " -> " ")
|
||||||
|
Loading…
Reference in New Issue
Block a user