mirror of
https://github.com/tealdeer-rs/tealdeer.git
synced 2026-08-09 09:49:10 +02:00
The Apple computer operating system was renamed from "OS X" to "macOS" in 2016. We should accept "macos" instead of "osx" in all our CLI APIs, and the docs should also mention this alias instead of "osx". For backwards compatibility and for compatibility with the tldr client specification, we should still accept "osx" though.
45 lines
1.4 KiB
Text
45 lines
1.4 KiB
Text
#compdef tldr
|
|
|
|
_applications() {
|
|
local -a commands
|
|
commands=(${(uonzf)"$(tldr --list 2>/dev/null)"//:/\\:})
|
|
_describe -t commands 'command' commands
|
|
}
|
|
|
|
_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 -p --platform)"{-p,--platform}'[Override the operating system]:platform:((
|
|
linux
|
|
macos
|
|
sunos
|
|
windows
|
|
))'
|
|
"($I -L --language)"{-L,--language}"[Override the language settings]:lang"
|
|
"($I -u --update)"{-u,--update}"[Update the local cache]"
|
|
"($I -c --clear-cache)"{-c,--clear-cache}"[Clear the local cache]"
|
|
"($I)--pager[Use a pager to page output]"
|
|
"($I -r --raw)"{-r,--raw}"[Display the raw markdown instead of rendering it]"
|
|
"($I -q --quiet)"{-q,--quiet}"[Suppress informational messages]"
|
|
"($I)--show-paths[Show file and directory paths used by tealdeer]"
|
|
"($I)--seed-config[Create a basic config]"
|
|
"($I)--color[Controls when to use color]:when:((
|
|
always
|
|
auto
|
|
never
|
|
))"
|
|
'(- *)'{-h,--help}'[Display help]'
|
|
'(- *)'{-v,--version}'[Show version information]'
|
|
'1: :_applications'
|
|
)
|
|
|
|
_arguments $args[@] && ret=0
|
|
return ret
|
|
}
|
|
|
|
_tealdeer
|