forked from tealdeer-rs/tealdeer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
zsh_tealdeer
38 lines (33 loc) · 1.11 KB
/
zsh_tealdeer
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#compdef tldr
_applications() {
_values 'applications' "${(uonzf)$(tldr --list | sed -e 's/, /\n/g')}"
}
_tealdeer() {
local I="-h --help -v --version"
integer ret=1
local -a args
args+=(
"($I -l --list)"{-l,--list}"[List all commands in the cache]"
"($I -f --render)"{-f,--render}"[Render a specific markdown file]:file:_files"
"($I -o --os)"{-o,--os}'[Override the operating system]:os:((
linux
osx
sunos
windows
))'
"($I -u --update)"{-u,--update}"[Update the local cache]"
"($I -c --clear-cache)"{-c,--clear-cache}"[Clear the local cache]"
"($I -p --pager)"{-p,--pager}"[Use a pager to page output]"
"($I -m --markdown)"{-m,--markdown}"[Display the raw markdown instead of rendering it]"
"($I -q --quiet)"{-q,--quiet}"[Suppress informational messages]"
"($I)--config-path[Show config file path]"
"($I)--seed-config[Create a basic config]"
'(- *)'{-h,--help}'[Display help]'
'(- *)'{-v,--version}'[Show version information]'
'*:file:_files'
'1: :_applications'
)
_arguments $args[@] && ret=0
return ret
}
_tealdeer