1
0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-09-22 03:40:47 +02:00

moved from Completion/AIX/_lscfg

This commit is contained in:
Sven Wischnowsky 2001-04-02 12:18:51 +00:00
parent 2da07b357d
commit ff910b0d63

View File

@ -0,0 +1,21 @@
#compdef lscfg
local state line expl curcontext="$curcontext" disp list devs
_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
zformat -a list ' -- ' "$devs[@]"
disp=(-ld list)
else
disp=()
fi
_wanted devices expl 'device' compadd "$disp[@]" - "${devs[@]%%:*}"
return
fi
return 1