tealdeer/bash_tealdeer
Gabriel Martinez 495c3e97d9 Support colors on Windows using ansi_term
We try to enable ANSI color support on Windows using the new APIs.
If that succeeds, we print colors as usual. If it fails, we disable
styles completely.
2019-02-09 21:44:10 -08:00

30 lines
583 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|--config-path|--seed-config|-q|--quiet)
return
;;
-f|--render)
_filedir
return
;;
-o|--os)
COMPREPLY=( $(compgen -W 'linux osx sunos windows' -- "${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