completions ip: remove base interface suffix for VLAN-enabled interfaces

When adding a VLAN-enabled interface, it is named like enp0s31f6.100@enp0s31f6
with the physical interface being appended behind an @.
But subsequent ip commands operate on the interface name without this suffix,
so it needs to be removed when completing interface names in __fish_ip_device
This commit is contained in:
exploide 2022-08-11 17:47:27 +02:00 committed by Fabian Boehm
parent 18df41e5e6
commit b5e746cbd4

View file

@ -177,7 +177,7 @@ end
function __fish_ip_device
command ip -o link show | while read -l a b c
printf '%s\t%s\n' (string replace ':' '' -- $b) Device
printf '%s\t%s\n' (string replace -r '(@.*)?:' '' -- $b) Device
end
end