2 # SPDX-License-Identifier: LGPL-2.1+
5 local -a _networkctl_cmds
7 'list:List existing links'
8 'status:Show information about the specified links'
9 'lldp:Show Link Layer Discovery Protocol status'
10 'label:Show address labels'
12 if (( CURRENT == 1 )); then
13 _describe -t commands 'networkctl command' _networkctl_cmds
15 local curcontext="$curcontext"
17 cmd="${${_networkctl_cmds[(r)$words[1]:*]%%:*}}"
18 if [ $cmd = "status" ]; then
19 _links=( "${(foa)$(networkctl list --no-legend | awk 'BEGIN{OFS=":"} {sub(/[[ \t]+/, ""); print $2,$0}' 2>/dev/null)}" )
20 if [[ -n "$_links" ]]; then
21 _describe -t links 'links' _links
26 _message "no more options"
32 {-a,--all}'[Show all links with status]' \
33 '--no-pager[Do not pipe output into a pager]' \
34 '--no-legend[Do not print the column headers]' \
35 {-h,--help}'[Show this help]' \
36 '--version[Show package version]' \
37 '*::networkctl commands:_networkctl_command'