theca 1.0.0

a simple, fully featured, command line note taking tool
Documentation
#compdef theca
#  _   _                    
# | |_| |__   ___  ___ __ _ 
# | __| '_ \ / _ \/ __/ _` |
# | |_| | | |  __/ (_| (_| |
#  \__|_| |_|\___|\___\__,_|
#
# licensed under the MIT license <http://opensource.org/licenses/MIT>
#
# _theca - v0.9.0
#   (minimal) zsh completion for the theca binary, this is really really
#   super annoying

typeset -A opt_args

_theca() {
	_arguments \
		'(-p, --profile)'{-p,--profile}'[name of the profile to load]' \
		'(-f, --profile-folder)'{-f,--profile-folder}'[path of the profile folder]' \
		'(-e, --encrypted)'{-e,--encrypted}'[specify whether profile is encrypted or not]' \
		'(-k, --key)'{-k,--key}'[specify a encryption key instead of waiting for a prompt]' \
		'(-l, --limit)'{-l,--limit}'[number of notes to limit list by]' \
		'(-r, --reverse)'{-r,--reverse}'[reverse note listing]' \
		'(-d, --datesort)'{-d,--datesort}'[sort note listing by date modified]' \
		'(-j, --json)'{-j,--json}'[output note lists as JSON]' \
		'(-c, --condensed)'{-c,--condensed}'[use the condensed printing style]' \
		'*:: :->args' \
		'1: :_theca_cmds' \

	case $state in
		args)
			case "$words[1]" in
				add)
					_arguments \
						'(-y, --yes)'{-y,--yes}'[say yes to all prompts]' \
						'(-s, --started)'{-s,--started}'[set note status to Started]' \
						'(-u, --urgent)'{-u,--urgent}'[set note status to Urgent]' \
						'(-b, --body)'{-b,--body}'[text to set note body to]' \
						'(-t, --editor)'{-t,--editor}'[set note body using visual editor]' \
					;;
				edit)
					_arguments \
						'(-p, --profile)'{-p,--profile}'[name of the profile to load]' \
						'(-f, --profile-folder)'{-f,--profile-folder}'[path of the profile folder]' \
						'(-e, --encrypted)'{-e,--encrypted}'[specify whether profile is encrypted or not]' \
						'(-k, --key)'{-k,--key}'[specify a encryption key instead of waiting for a prompt]' \
						'(-y, --yes)'{-y,--yes}'[say yes to all prompts]' \
						'(-s, --started)'{-s,--started}'[set note status to Started]' \
						'(-u, --urgent)'{-u,--urgent}'[set note status to Urgent]' \
						'(-n, --none)'{-n,--none}'[set note status to None]' \
						'(-b, --body)'{-b,--body}'[text to set note body to]' \
						'(-t, --editor)'{-t,--editor}'[set note body using visual editor]' \
					;;
				search)
					_arguments \
						'(-p, --profile)'{-p,--profile}'[name of the profile to load]' \
						'(-f, --profile-folder)'{-f,--profile-folder}'[path of the profile folder]' \
						'(-e, --encrypted)'{-e,--encrypted}'[specify whether profile is encrypted or not]' \
						'(-k, --key)'{-k,--key}'[specify a encryption key instead of waiting for a prompt]' \
						'--regex[search using a regex pattern]' \
						'--search-body[search notes by body instead of title]' \
						'(-l, --limit)'{-l,--limit}'[number of notes to limit list by]' \
						'(-r, --reverse)'{-r,--reverse}'[reverse note listing]' \
						'(-d, --datesort)'{-d,--datesort}'[sort note listing by date modified]' \
						'(-j, --json)'{-j,--json}'[output note lists as JSON]' \
						'(-c, --condensed)'{-c,--condensed}'[use the condensed printing style]' \
					;;
				del|clear|transfer|import|new-profile)
					_arguments \
						'(-p, --profile)'{-p,--profile}'[name of the profile to load]' \
						'(-f, --profile-folder)'{-f,--profile-folder}'[path of the profile folder]' \
						'(-e, --encrypted)'{-e,--encrypted}'[specify whether profile is encrypted or not]' \
						'(-k, --key)'{-k,--key}'[specify a encryption key instead of waiting for a prompt]' \
						'(-y, --yes)'{-y,--yes}'[say yes to all prompts]' \
					;;
				encrypt-profile)
					_arguments \
						'(-p, --profile)'{-p,--profile}'[name of the profile to load]' \
						'(-f, --profile-folder)'{-f,--profile-folder}'[path of the profile folder]' \
						'(-e, --encrypted)'{-e,--encrypted}'[specify whether profile is encrypted or not]' \
						'(-k, --key)'{-k,--key}'[specify a encryption key instead of waiting for a prompt]' \
						'(--new-key)[new encryption key to use (for encrypt-profile)]' \
					;;
				decrypt-profile)
					_arguments \
						'(-p, --profile)'{-p,--profile}'[name of the profile to load]' \
						'(-f, --profile-folder)'{-f,--profile-folder}'[path of the profile folder]' \
						'(-e, --encrypted)'{-e,--encrypted}'[specify whether profile is encrypted or not]' \
						'(-k, --key)'{-k,--key}'[specify a encryption key instead of waiting for a prompt]' \
					;;
				list-profiles)
					_arguments \
						'(-f, --profile-folder)'{-f,--profile-folder}'[path of the profile folder]' \
					;;
				info)
					_arguments \
						'(-p, --profile)'{-p,--profile}'[name of the profile to load]' \
						'(-f, --profile-folder)'{-f,--profile-folder}'[path of the profile folder]' \
						'(-e, --encrypted)'{-e,--encrypted}'[specify whether profile is encrypted or not]' \
						'(-k, --key)'{-k,--key}'[specify a encryption key instead of waiting for a prompt]' \
					;;
			esac
			;;
	esac
}

_theca_cmds(){
	local -a commands
	commands=(
		':list all notes'
		'add:add a new note'
		'edit:edit a existing note'
		'del:delete a existing note'
		'transfer:transfer a note from the current profile to another profile'
		'import:transfer a note from a different profile to the current profile'
		'search:search for notes in the current profile'
		'info:print information about the current profile'
		'new-profile:create a new profile'
		'encrypt-profile:encrypt a plaintext profile or change the key for an encrypted profile'
		'decrypt-profile:decrypt a encrypted profile'
		'list-profiles:list all the profiles in the current profile folder'
		'-h, --help:show the help message'
		'-v, --version:show version information'
	)
	_describe 'command' commands
}

_theca