about summary refs log tree commit diff
path: root/Completion/Solaris/Command/_beadm
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2012-06-21 08:50:14 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2012-06-21 08:50:14 +0000
commit71052cb69c455f8182e8f85ba8d4ea4be7e5caf0 (patch)
tree3cc9aa0959c21dfd32344e068dea009ec9f0af08 /Completion/Solaris/Command/_beadm
parentcbb8a3c762ba6034e5ae0c35e6d04c2de130f933 (diff)
downloadzsh-71052cb69c455f8182e8f85ba8d4ea4be7e5caf0.tar.gz
zsh-71052cb69c455f8182e8f85ba8d4ea4be7e5caf0.tar.xz
zsh-71052cb69c455f8182e8f85ba8d4ea4be7e5caf0.zip
Danek (plus .distfiles): 30520: updated Solaris 11 copmletion
Diffstat (limited to 'Completion/Solaris/Command/_beadm')
-rw-r--r--Completion/Solaris/Command/_beadm76
1 files changed, 76 insertions, 0 deletions
diff --git a/Completion/Solaris/Command/_beadm b/Completion/Solaris/Command/_beadm
new file mode 100644
index 000000000..6e498bee3
--- /dev/null
+++ b/Completion/Solaris/Command/_beadm
@@ -0,0 +1,76 @@
+#compdef beadm
+
+_beadm() {
+	local context state line subcmds
+	typeset -A opt_args
+
+	subcmds=( activate create destroy list mount rename unmount )
+
+	if [[ $service == "beadm" ]]; then
+		_arguments -C -A "-*" \
+			'*::command:->subcmd' && return 0
+
+		if (( CURRENT == 1 )); then
+			_wanted commands expl 'beadm subcommand' compadd -a subcmds
+			return
+		fi
+		service="$words[1]"
+		curcontext="${curcontext%:*}=$service:"
+	fi
+
+	case $service in
+	(activate)
+		_arguments -A "-*" \
+			':BE name:_be_name'
+		;;
+
+	(create)
+		# TODO: Add support for -o, and for creating snapshots
+		_arguments -A "-*" \
+			'-a[Activate new BE]' \
+			'-d[Description]:' \
+			'-e[Base BE]:BE name or snapshot:_be_name -t all' \
+			'-p[Create new BE in specified ZFS pool]:ZFS pool:_zfs_pool' \
+			':new BE name:'
+		;;
+
+	(destroy)
+		_arguments -A "-*" \
+			'-f[Unmount BE if necessary]' \
+			"-F[Don't prompt for verification]" \
+			':BE or BE snapshot:_be_name'
+		;;
+
+	(list)
+		_arguments -A "-*" \
+			'-a[List subordinate filesystems and snapshots]' \
+			'-d[List subordinate filesystems]' \
+			'-s[List snapshots]' \
+			'-H[Parseable format]' \
+			':BE name:_be_name'
+		;;
+
+	(mount)
+		_arguments -A "-*" \
+			':BE name:_be_name' \
+			':mountpoint:_path_files -/'
+		;;
+
+	(rename)
+		_arguments -A "-*" \
+			':existing BE name:_be_name' \
+			':new BE name:'
+		;;
+
+	(unmount)
+		_arguments -A "-*" \
+			'-f[Force unmount]' \
+			':BE name:_be_name'
+		;;
+
+	(*)
+		_message "unknown beadm subcommand: $service"
+	esac
+}
+
+_beadm "$@"