mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-03-07 02:37:43 +08:00
completions/nmcli: Exit if networkmanager isn't running
These printed an error on load if networkmanager isn't running. Since at that point it's not useful to complete anything, just try the first call and if that fails exit. (cherry picked from commit b6f47f76f00ecf2b019de7fd91aa5b8a698679d5)
This commit is contained in:
parent
8f11ebb9d4
commit
625d9e05d8
@ -1,4 +1,6 @@
|
||||
set -l cname (string escape -- (nmcli -g NAME connection show --active)\t"Active connection")
|
||||
set -l nmoutput (nmcli -g NAME connection show --active 2>/dev/null)
|
||||
or exit # networkmanager isn't running, no point in completing
|
||||
set -l cname (string escape -- $nmoutput\t"Active connection")
|
||||
set -a cname (string escape -- (nmcli -g NAME connection show)\t"Connection")
|
||||
set -l ifname (string escape -- (nmcli -g DEVICE device status)\t"Interface name")
|
||||
set -l ssid (string escape -- (nmcli -g SSID device wifi list)\t"SSID")
|
||||
|
Loading…
x
Reference in New Issue
Block a user