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.
34 lines
700 B
Bash
34 lines
700 B
Bash
# tealdeer bash completion
|
|
|
|
_tealdeer()
|
|
{
|
|
local cur prev words cword
|
|
_init_completion || return
|
|
|
|
case $prev in
|
|
-h|--help|-v|--version|-l|--list|-u|--update|-c|--clear-cache|-p|--pager|-r|--raw|--show-paths|--seed-config|-q|--quiet)
|
|
return
|
|
;;
|
|
-f|--render)
|
|
_filedir
|
|
return
|
|
;;
|
|
-p|--platform)
|
|
COMPREPLY=( $(compgen -W 'linux macos sunos windows' -- "${cur}") )
|
|
return
|
|
;;
|
|
--color)
|
|
COMPREPLY=( $(compgen -W 'always auto never' -- "${cur}") )
|
|
return
|
|
;;
|
|
esac
|
|
|
|
if [[ $cur == -* ]]; then
|
|
COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
|
|
return
|
|
fi
|
|
|
|
COMPREPLY=( $(compgen -W '$( tldr -l | tr -d , )' -- "${cur}") )
|
|
}
|
|
|
|
complete -F _tealdeer tldr
|