about summary refs log tree commit diff
path: root/Completion/Solaris/Type
diff options
context:
space:
mode:
authorOliver Kiddle <opk@zsh.org>2015-05-03 16:53:47 +0200
committerOliver Kiddle <opk@zsh.org>2015-05-03 16:53:57 +0200
commitab7ec8d9851fea8230e1ccfba284c5bfaf457d88 (patch)
tree837b14c838b96728ebdb530eb20d35737ef8419b /Completion/Solaris/Type
parentb29278c69a67089ba225a98478069eb3f32ab4e6 (diff)
downloadzsh-ab7ec8d9851fea8230e1ccfba284c5bfaf457d88.tar.gz
zsh-ab7ec8d9851fea8230e1ccfba284c5bfaf457d88.tar.xz
zsh-ab7ec8d9851fea8230e1ccfba284c5bfaf457d88.zip
35011: update completions for some common Unix commands,
in particular improving FreeBSD support
Diffstat (limited to 'Completion/Solaris/Type')
-rw-r--r--Completion/Solaris/Type/_be_name17
-rw-r--r--Completion/Solaris/Type/_zones8
2 files changed, 9 insertions, 16 deletions
diff --git a/Completion/Solaris/Type/_be_name b/Completion/Solaris/Type/_be_name
index b25a8ff22..4b80c65f2 100644
--- a/Completion/Solaris/Type/_be_name
+++ b/Completion/Solaris/Type/_be_name
@@ -1,18 +1,13 @@
 #autoload
 
-local -a type be_names
-local name uuid activate mtpt space policy created snap
+local -a type be_names expl
 
 zparseopts -D -E -a type t+:
 
-beadm list -H | while IFS=\; read name uuid active mtpt space policy created; do
-	be_names=( $be_names $name )
-done
+be_names=( ${${(f)"$(_call_program boot-environs beadm list -H)"}%%;*} )
 
-if [[ -n $type[(r)all] ]]; then
-	beadm list -sH | while IFS=\; read name snap space policy created; do
-		be_names=( $be_names $snap )
-	done
-fi
+[[ -n $type[(r)all] ]] &&
+  be_names+=( ${${${(f)"$(_call_program boot-environs beadm list -sH)"}#*;}%%;*} )
 
-compadd "$@" - $be_names
+_description boot-environs expl 'boot environment'
+compadd "$@" "$expl[@]" -a be_names
diff --git a/Completion/Solaris/Type/_zones b/Completion/Solaris/Type/_zones
index 0c2d273a2..92064d2b8 100644
--- a/Completion/Solaris/Type/_zones
+++ b/Completion/Solaris/Type/_zones
@@ -1,13 +1,11 @@
 #autoload
 
-local -a type typearg
-local zonelist
+local -a type typearg expl
 
 zparseopts -D -E -a type t+:
 
 [[ -n $type[(r)c] ]] && typearg=-c
 [[ -n $type[(r)i] ]] && typearg=-i
 
-zonelist=( ${="$(zoneadm list $typearg)"} )
-
-compadd "$@" - $zonelist
+_description zones expl zone
+compadd "$@" "$expl[@]" - ${="$(_call_program zones /usr/sbin/zoneadm list $typearg)"}