tealdeer/bash_tealdeer
Danilo Bargen 72d753c52b
Add "macos" alias for "osx" (#215)
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.
2021-12-05 16:38:35 +01:00

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