mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-14 05:53:59 +00: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 b6f47f76f0
)
This commit is contained in:
parent
8f11ebb9d4
commit
625d9e05d8
1 changed files with 3 additions and 1 deletions
|
@ -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…
Reference in a new issue