1
0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-10-02 17:01:19 +02:00
zsh/Completion/AIX/Command/_lscfg

23 lines
658 B
Plaintext
Raw Normal View History

2001-04-02 14:18:51 +02:00
#compdef lscfg
local state line expl curcontext="$curcontext" disp list devs sep
2001-04-02 14:18:51 +02:00
_arguments -C -s \
'-l[display device information for named device]:device:->device' \
'-v[display vital product data for physical devices]' && return 0
if [[ "$state" = device ]]; then
devs=( ${${${${(f)"$(lscfg)"}[6,-1]:# *}##??}/ ##[^ ]# #/:} )
if zstyle -T ":completion:${curcontext}:devices" verbose; then
zstyle -s ":completion:${curcontext}:devices" list-separator sep || sep=--
zformat -a list " $sep " "$devs[@]"
2001-04-02 14:18:51 +02:00
disp=(-ld list)
else
disp=()
fi
_wanted devices expl 'device' compadd "$disp[@]" - "${devs[@]%%:*}"
return
fi
return 1