about summary refs log tree commit diff
path: root/Completion/AIX/Command/_lscfg
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2001-04-02 12:18:51 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2001-04-02 12:18:51 +0000
commitff910b0d6344bbdd7ca7b7905dc94c39398cf7c6 (patch)
treecf9e5ec77f3d2a8f0614e8222e9405bcca69fc12 /Completion/AIX/Command/_lscfg
parent2da07b357d451cbdae94f1a67e31c656e974d775 (diff)
downloadzsh-ff910b0d6344bbdd7ca7b7905dc94c39398cf7c6.tar.gz
zsh-ff910b0d6344bbdd7ca7b7905dc94c39398cf7c6.tar.xz
zsh-ff910b0d6344bbdd7ca7b7905dc94c39398cf7c6.zip
moved from Completion/AIX/_lscfg
Diffstat (limited to 'Completion/AIX/Command/_lscfg')
-rw-r--r--Completion/AIX/Command/_lscfg21
1 files changed, 21 insertions, 0 deletions
diff --git a/Completion/AIX/Command/_lscfg b/Completion/AIX/Command/_lscfg
new file mode 100644
index 000000000..4667a0bd7
--- /dev/null
+++ b/Completion/AIX/Command/_lscfg
@@ -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