tealdeer/completion/bash_tealdeer
Evan Lloyd New-Schmidt 4a5410fd0b Add support for android platform
tldr added android-specific commands under a new 'android' platform
last year: <https://github.com/tldr-pages/tldr/issues/5462>
2022-06-02 12:36:20 -04:00

34 lines
722 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|--no-auto-update|-c|--clear-cache|--pager|-r|--raw|--show-paths|--seed-config|-q|--quiet)
return
;;
-f|--render)
_filedir
return
;;
-p|--platform)
COMPREPLY=( $(compgen -W 'linux macos sunos windows android' -- "${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