mirror of
https://github.com/fish-shell/fish-shell
synced 2024-11-10 15:14:44 +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.
This commit is contained in:
parent
4c40283d00
commit
b6f47f76f0
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