mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-27 05:13:10 +00:00
Fix wg-quick completion running from root
`wg show` command shows entire interfaces configuration, not just the list. This breaks completion when running fish from root, because command output looks like this: interface: wg0 public key: fred2rX85AxpcTObLuiWTzkRPZaXjnhd1C4XOdZOGWs= private key: (hidden) listening port: 12345 fwmark: 0xca6c peer: g2YHHDkxmgoT9EV0TxKtq556WLXpaOh4zgC5L7EAGTQ= endpoint: 192.168.88.50:54321 allowed ips: 0.0.0.0/0, ::/0 latest handshake: 1 minute, 37 seconds ago transfer: 1.83 MiB received, 927.19 KiB sent To show just the list of active interfaces, `wg show interfaces` should be used instead.
This commit is contained in:
parent
8df5547f2d
commit
bb108435bb
1 changed files with 1 additions and 1 deletions
|
@ -1,7 +1,7 @@
|
|||
set -l valid_subcmds up down strip save
|
||||
|
||||
function __fish_wg_complete_interfaces
|
||||
LC_ALL=C wg show 2>| string replace -rf 'Unable to access interface (.*): Operation not permitted' '$1'
|
||||
wg show interfaces
|
||||
end
|
||||
|
||||
complete -c wg-quick -f
|
||||
|
|
Loading…
Reference in a new issue