#compdef makoctl

local -a makoctl_cmds

makoctl_cmds=(
	'dismiss:Dismiss notification (first by default)'
	'restore:Restore the most recently expired notification from the history buffer'
	'invoke:Invoke an action on the first notification. If action is not specified, invoke the default action'
	'list:Retrieve a list of current notifications'
	'reload:Reload the configuration file'
	'help:Show help message and quit'
)

if (( CURRENT == 2 )); then
	_describe 'makoctl command' makoctl_cmds
else
	shift words
	(( CURRENT-- ))
	opt="${words[1]}"

	if (( CURRENT == 2 )); then
		case "${opt}" in
			dismiss)
				_arguments -s \
						   '(-a --all)'{-a,--all}'[Dimiss all notification]'
				;;
			invoke)
				_message -e action 'action'
				;;
		esac
	fi
fi
