From ab7ec8d9851fea8230e1ccfba284c5bfaf457d88 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Sun, 3 May 2015 16:53:47 +0200 Subject: 35011: update completions for some common Unix commands, in particular improving FreeBSD support --- Completion/Solaris/Type/_be_name | 17 ++++++----------- Completion/Solaris/Type/_zones | 8 +++----- 2 files changed, 9 insertions(+), 16 deletions(-) (limited to 'Completion/Solaris/Type') 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)"} -- cgit 1.4.1