about summary refs log tree commit diff
path: root/Completion/Unix/Command/_pkg_instance
diff options
context:
space:
mode:
Diffstat (limited to 'Completion/Unix/Command/_pkg_instance')
-rw-r--r--Completion/Unix/Command/_pkg_instance20
1 files changed, 20 insertions, 0 deletions
diff --git a/Completion/Unix/Command/_pkg_instance b/Completion/Unix/Command/_pkg_instance
new file mode 100644
index 000000000..3f4c49219
--- /dev/null
+++ b/Completion/Unix/Command/_pkg_instance
@@ -0,0 +1,20 @@
+#autoload
+
+local -A opts
+local whicharg
+
+zparseopts -E -D -- '-_opts:=opts'
+
+whicharg=${opts#*:}
+
+case ${opts%:*} in
+(installed)
+	compadd "$@" - ${opt_args[$whicharg]}/var/sadm/pkg/*/pkginfo(:h:t)
+	;;
+(spooled)
+	compadd "$@" - ${opt_args[$whicharg]}/*(:t)
+	;;
+(uninstalled)
+	compadd "$@" - ${opt_args[$whicharg]:-/var/spool/pkg}/*/pkgmap(:h:t)
+	;;
+esac