1
0
Fork 0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2024-12-04 19:50:08 +00:00
ohmyzsh/plugins/geeknote/_geeknote

137 lines
3.7 KiB
Text
Raw Normal View History

2014-01-01 23:35:19 +00:00
#compdef geeknote
# --------------- ------------------------------------------------------------
# Name : _geeknote
# Synopsis : zsh completion for geeknote
# Author : Ján Koščo <3k.stanley@gmail.com>
# HomePage : http://www.geeknote.me
# Version : 0.1
# Tag : [ shell, zsh, completion, evernote ]
# Copyright : © 2014 by Ján Koščo,
# Released under current GPL license.
# --------------- ------------------------------------------------------------
local -a _1st_arguments
_1st_arguments=(
'login'
'logout'
'settings'
'create'
'edit'
'find'
'show'
'remove'
'notebook-list'
'notebook-create'
'notebook-edit'
'tag-list'
'tag-create'
'tag-edit'
2014-08-22 21:11:52 +00:00
'tag-remove'
2014-01-01 23:35:19 +00:00
'gnsync'
'user'
)
_arguments '*:: :->command'
if (( CURRENT == 1 )); then
_describe -t commands "geeknote command" _1st_arguments
return
fi
local -a _command_args
case "$words[1]" in
user)
_command_args=(
'(--full)--full' \
)
;;
logout)
_command_args=(
'(--force)--force' \
)
;;
settings)
_command_args=(
'(--editor)--editor' \
)
;;
create)
_command_args=(
'(-t|--title)'{-t,--title}'[note title]' \
'(-c|--content)'{-c,--content}'[note content]' \
'(-tg|--tags)'{-tg,--tags}'[one tag or the list of tags which will be added to the note]' \
'(-nb|--notebook)'{-nb,--notebook}'[name of notebook where to save note]' \
)
;;
edit)
_command_args=(
'(-n|--note)'{-n,--note}'[name or ID from the previous search of a note to edit]' \
'(-t|--title)'{-t,--title}'[note title]' \
'(-c|--content)'{-c,--content}'[note content]' \
'(-tg|--tags)'{-tg,--tags}'[one tag or the list of tags which will be added to the note]' \
'(-nb|--notebook)'{-nb,--notebook}'[name of notebook where to save note]' \
)
;;
remove)
_command_args=(
'(-n|--note)'{-n,--note}'[name or ID from the previous search of a note to edit]' \
'(--force)--force' \
)
;;
show)
_command_args=(
'(-n|--note)'{-n,--note}'[name or ID from the previous search of a note to edit]' \
)
;;
find)
_command_args=(
'(-s|--search)'{-s,--search}'[text to search]' \
'(-tg|--tags)'{-tg,--tags}'[notes with which tag/tags to search]' \
'(-nb|--notebook)'{-nb,--notebook}'[in which notebook search the note]' \
'(-d|--date)'{-d,--date}'[date in format dd.mm.yyyy or date range dd.mm.yyyy-dd.mm.yyyy]' \
'(-cn|--count)'{-cn,--count}'[how many notes show in the result list]' \
2014-08-22 21:12:02 +00:00
'(-uo|--url-only)'{-uo,--url-only}'[add direct url of each note in results to Evernote web-version]' \
2014-01-01 23:35:19 +00:00
'(-ee|--exact-entry)'{-ee,--exact-entry}'[search for exact entry of the request]' \
'(-cs|--content-search)'{-cs,--content-search}'[search by content, not by title]' \
)
;;
notebook-create)
_command_args=(
'(-t|--title)'{-t,--title}'[notebook title]' \
)
;;
notebook-edit)
_command_args=(
'(-nb|--notebook)'{-nb,--notebook}'[name of notebook to rename]' \
'(-t|--title)'{-t,--title}'[new notebook title]' \
)
;;
notebook-remove)
_command_args=(
'(-nb|--notebook)'{-nb,--notebook}'[name of notebook to remove]' \
'(--force)--force' \
)
;;
tag-create)
_command_args=(
'(-t|--title)'{-t,--title}'[title of tag]' \
)
;;
2014-08-22 21:11:52 +00:00
tag-edit)
2014-01-01 23:35:19 +00:00
_command_args=(
'(-tgn|--tagname)'{-tgn,--tagname}'[tag to edit]' \
'(-t|--title)'{-t,--title}'[new tag name]' \
)
;;
tag-remove)
_command_args=(
'(-tgn|--tagname)'{-tgn,--tagname}'[tag to remove]' \
'(--force)--force' \
)
;;
esac
_arguments \
$_command_args \
&& return 0