-
-
Notifications
You must be signed in to change notification settings - Fork 74
/
Copy path_tldr
21 lines (19 loc) · 942 Bytes
/
_tldr
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#compdef tldr
local -a pages platforms
pages=$(tldr -a1)
platforms='( android linux osx sunos windows )'
_arguments \
'(- *)'{-h,--help}'[show help]' \
'(- *)'{-v,--version}'[display version]' \
'(- *)'{-l,--list}'[list all commands for chosen platform]' \
'(- *)'{-a,--list-all}'[list all commands]' \
'(- *)'{-1,--single-column}'[list one command per line (used with -l or -a)]' \
'(- *)'{-r,--random}'[show a random command]' \
'(- *)'{-s,--search}'[search all pages for query]' \
'(- *)'{-e,--random-example}'[show a random example]' \
'(- *)'{-m,--markdown}'[show the original markdown format page]' \
'(-f --render)'{-f,--render}'[render a specific markdown file]:markdown file:_files -/' \
'(-p --platform)'{-p,--platform}"[override platform]:platform:(${(j:|:)platforms})" \
'(- *)'{-u,--update}'[update local cache]' \
'(- *)'{-c,--clear-cache}'[clear local cache]' \
"*:page:(${(b)pages})" && return 0