mirror of
https://github.com/tealdeer-rs/tealdeer.git
synced 2026-08-09 09:49:10 +02:00
34 lines
698 B
Bash
34 lines
698 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|-m|--markdown|--config-path|--seed-config|-q|--quiet)
|
|
return
|
|
;;
|
|
-f|--render)
|
|
_filedir
|
|
return
|
|
;;
|
|
-o|--os)
|
|
COMPREPLY=( $(compgen -W 'linux osx 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
|