about summary refs log tree commit diff
path: root/Completion/Unix/Command/_zpool
diff options
context:
space:
mode:
Diffstat (limited to 'Completion/Unix/Command/_zpool')
-rw-r--r--Completion/Unix/Command/_zpool13
1 files changed, 5 insertions, 8 deletions
diff --git a/Completion/Unix/Command/_zpool b/Completion/Unix/Command/_zpool
index 0f18eefb5..03ebd0642 100644
--- a/Completion/Unix/Command/_zpool
+++ b/Completion/Unix/Command/_zpool
@@ -12,7 +12,7 @@ _zpool() {
 	)
 
 	versions=(
-		${${${(M)"${(f)$(zpool upgrade -v)}":#[[:space:]]#<->*}##[[:space:]]}%%[[:space:]]*}
+		${${${(M)"${(f)$(_call_program versions zpool upgrade -v)}":#[[:space:]]#<->*}##[[:space:]]}%%[[:space:]]*}
 	)
 
 	ro_props=(
@@ -87,15 +87,12 @@ _zpool() {
 
 	if [[ $service == "zpool" ]]; then
 		_arguments -C -A "-*" \
-			'-\?[Help]' \
-			'*::command:->subcmd' && return 0
+			'-\?[show help information]' \
+			'1:subcommand:compadd -a subcmds' \
+			'*:: :->subcmd' && return
 
-		if (( CURRENT == 1 )); then
-			_wanted commands expl "zpool subcommand" compadd -a subcmds
-			return
-		fi
 		service="$words[1]"
-		curcontext="${curcontext%:*}=$service:"
+		curcontext="${curcontext%:*}-$service:"
 	fi
 
 	case $service in